-
Notifications
You must be signed in to change notification settings - Fork 80
calcite-select: Allow having no initial value #4032
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
Comments
This one's tough as we match native behavior and there is no native placeholder attribute. The single-select combobox could accomplish this:
Although the above does not allow you to clear selection - not sure if that is desirable for your workflow. |
@macandcheese what're your thoughts on supporting |
That would work - it seems like that works only when |
If it only works for the first option, then your suggestion certainly sounds cleaner to me rather than adding a |
@macandcheese @jcfranco @benelan are there any plans to support this in one of the upcoming releases? We have a lot of UIs in ArcGIS Velocity we would like to migrate but this is the only issue blocking us from doing so since we don't want to have a mixed experience (UI controls from different component libraries on the same page). |
Would using an 'empty' option work in the meantime? https://codepen.io/jcfranco/pen/oNqMBRJ?editors=1010
Assuming ☝️ was fixed, would this address this issue or are there additional functional differences from the MDN example? |
@jcfranco yes, I think we could go with the 'empty' option for now. Thank you. It seems like it's still getting initialized with the first The only remaining thing that would be great to have (and is a functional difference) is the |
It looks like this issue is missing some information:
Issues without reproduction samples may not be prioritized. If you were unable to create a sample, please try to answer any questions that arise once development begins. Thanks for your understanding. |
|
**Related Issue:** #4032 ## Summary This fixes an issue where an empty string value was treated as value not set and would therefore fall back to the label as the value.
Installed and assigned for verification. |
Verified in |
Uh oh!
There was an error while loading. Please reload this page.
Description
It is sometimes useful to have no initial value for a
select
to coerce the user to make an explicit decision. Currently this seems to not be supported bycalcite-select
since it seems to always be initialized with the firstcalcite-option
child's value ifvalue
is undefined and nocalcite-option
isselected
. In plain HTML,<option hidden disabled />
might be used, however doing<calcite-option hidden disabled />
still causes it to be visible in the menu.Acceptance Criteria
value
is set, and nocalcite-option
is selected, thecalcite-select
renders its placeholder and does not initialize itself with a default valueRelevant Info
No response
Which Component
calcite-select
Example
https://codepen.io/arjan_esrinl/pen/ZEmgaVv
The text was updated successfully, but these errors were encountered: