Skip to content
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

Merged
merged 2 commits into from
Feb 16, 2023

Conversation

samuel-gomez
Copy link
Contributor

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

$ npm test

# watch for changes
$ npm test -- --watch

# For a specific file (e.g., in packages/context/__tests__/command.test.js)
$ npm test -- --watch packages/action

@@ -43,7 +37,6 @@ const SelectDefault = ({
onChange(e);
setHasHandleChangeOnce(!forceDisplayPlaceholder);
Copy link
Contributor

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);

Copy link
Contributor Author

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

Copy link
Contributor Author

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

Copy link
Contributor

@SamuelHsn SamuelHsn Feb 15, 2023

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;
Copy link
Contributor

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];

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@SamuelHsn, done

@SamuelHsn SamuelHsn self-requested a review February 15, 2023 16:00
@samuel-gomez samuel-gomez merged commit b58d537 into master Feb 16, 2023
@delete-merged-branch delete-merged-branch bot deleted the fix/forceDisplayPlaceholder branch February 16, 2023 08:35
@MartinWeb MartinWeb added this to the v2.1.0 milestone Sep 13, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Select] forceDisplayPlaceholder not working classModifier not added in select component
5 participants