-
Notifications
You must be signed in to change notification settings - Fork 62
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix(select): classModifier and forceDisplayPlaceholder #1013
Conversation
@@ -43,7 +37,6 @@ const SelectDefault = ({ | |||
onChange(e); | |||
setHasHandleChangeOnce(!forceDisplayPlaceholder); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Si le onChange est appelé plusieurs fois, le hasHandleChangeOnce va alterner entre true & false à chaque fois
Le but c'est pas de le mettre à true au moment où on passe au moins une fois fois dans le onChange?
suggestion: setHasHandleChangeOnce(true);
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
non car la valeur de forceDisplayMessage n'est définie qu'une seule fois depuis les props
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
elle permet justement de donner la main au consommateur de garder ou pas le placeholder
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah oui en effet j'ai mal lu désolé
); | ||
const newOptions = !hasHandleChangeOnce | ||
? [{ value: '', label: placeholder }, ...options] | ||
: options; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
suggestion : const newOptions = hasHandleChangeOnce ? options : [{ value: '', label: placeholder }, ...options];
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@SamuelHsn, done
Related issue
Reference to the issue
fix #1012
fix #1008
Description of the issue
Fix for apply classModifier on select field
Fix for display placeholder with forceDisplayPlaceholder
Person(s) for reviewing proposed changes
@SamuelHsn @johankorger
Important
Before creating a pull request run unit tests