Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
webf
react-webf
Commits
23fa4a23
Commit
23fa4a23
authored
Feb 25, 2020
by
Mickaël Bourgier
Browse files
🔊
[ListItem] Add deprecation when `clickable` is falsy and `onClick` defined
parent
a554a52b
Changes
2
Hide whitespace changes
Inline
Side-by-side
CHANGELOG.md
View file @
23fa4a23
## v1.3.0 (unreleased)
### Deprecations
-
**[Collapse, Fade, Slide]**
Using default value of the
`appear`
prop is
deprecated since it will change from
`false`
to
`true`
in v2.0 (!2 by @chapa)
-
**[ListItem]**
Using a falsy value for the
`clickable`
prop when
`onClick`
is
defined is deprecated since it will have no effect in v2.0 (!9 by @chapa)
### Bug fixes
-
**[ListItem]**
Prevent default event on click if component is "a"
-
**[CssBaseline/colors]**
Fix all colors were undefined
-
**[CssBaseline/reboot]**
Use primary color for links
### New features
-
**[CssBaseline]**
Add "cursor" feature (!7 by @chapa)
...
...
src/ListItem/ListItem.js
View file @
23fa4a23
...
...
@@ -105,9 +105,26 @@ ListItem.propTypes = {
className
:
PropTypes
.
string
,
/**
* @deprecated
* Donne l'impression que l'élément est cliquable
*/
clickable
:
PropTypes
.
bool
,
clickable
:
(
props
,
propName
,
componentName
,
location
,
propFullName
)
=>
{
const
componentNameSafe
=
componentName
||
'
<<anonymous>>
'
;
const
propFullNameSafe
=
propFullName
||
propName
;
if
(
!
props
[
propName
]
&&
typeof
props
.
onClick
!==
'
undefined
'
)
{
return
new
Error
(
`A falsy value in
\`
${
propFullNameSafe
}
\`
${
location
}
of `
+
`
\`
${
componentNameSafe
}
\`
will be ignored in v2.0 when the `
+
`
\`
onClick
\`
prop is defined. Do not set a falsy value when `
+
`
\`
onClick
\`
is defined. See `
+
`https://git.webalternatif.com/webf/react-webf/issues/28 for more `
+
`infos.`
);
}
return
null
;
},
/**
* Couleur de l'élément, par défaut `'primary'` uniquement si la valeur de
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment