-
-
Notifications
You must be signed in to change notification settings - Fork 46
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
Option to not unselect current selection on click #256
Comments
It seems this behavior has disappeared in transition from v3. It makes sense to be coupled with |
This behavior (as it is now after the modifications) is strange. The
I find the new behavior counter-intuitive. In the example above, I cannot erase "Current" with I just updated to v4 and discovered this a little bit late in the process, by accident, as it is not mentioned in the docs. If the issue is with a value being deselected upon clicking on it, the solution shouldn't involve the |
You are mixing 2 things:
ad 1. this is definitely a bug. You should be able to always remove created option ad 2. I would keep it the it is. You can force the same behavior with native select, that after initial selection, there will always be one. And if you want to force selection, it makes sense to couple it with Maybe the ability to "de-select" option (for non-required select) by selecting it again should / could be controllable by som property 🤔 Because that's not how native single-select behaves. |
Indeed, I was sure that you could de-select a native I didn't know that you could include a "hidden" option with But I agree with the fact that a creatable option should be removed. If the field is required, then it should become "invalid" (as it was before version 4.4.0). |
I created separated issue for the Regarding the ability to deselect option by clicking on it again: I changed the behavior in v4 to be the same for single & multi select (for multiselect you need to enable But you would prefer the v3 behavior? To be unable to de-select option by selecting it again, right? It will just add another difference between single & multiselect.
Btw at least iPhone is still showing even the placeholder item, but work as expected on desktop. |
I don't think that what I prefer is relevant. The component isn't made for me only.
I don't see this behavior with V3. When an item is selected, I can click again on the component (the dropdown list then shows up), I can click on the same item in the dropdown list (if it's a single select) and none of these clicks de-selects the option. I don't really see what @mhkeller means in the original post. I just know that since v4.4.0 you can't clear a required input once you have selected an option. |
I've just released new version (4.5.0) with new property @scoopandrun you want to set this property to @mhkeller you want to set this property to This prop is available in global config, so you can specify it for whole app. |
If an item is selected in my list and I click on it, it gets unselected. Is there a prop to disable this behavior so that it behaves more like a native
<select>
element and the list always has a selection? I thoughtrequired
would do that but I get the same behavior.The text was updated successfully, but these errors were encountered: