-
Notifications
You must be signed in to change notification settings - Fork 2.1k
MDC Select - no longer form input compatible #2221
Comments
Firstly, sorry for unwittingly causing trouble with this one. 😓 We initially removed the CSS-only variant to reduce the amount of code that would shift as we continued with design work, but clearly overlooked a crucial use case in doing so. We had a discussion today about how to reinstate interop with native HTML forms in some form today, and we want to bring our designers up to speed and have a discussion with them in case it affects their guidance regarding drop-down inputs on the web. In the interim, if you need a MDC Select's value to be present in an HTML form submission, I would suggest listening to the |
Also consider that native select provides faster keyboard access to long select lists with almost every modern browser for free. |
@kfranqueiro @micdalco I think this is a critical issue. Form inputs are still paramount to classic web development, and the |
@aaronhudon we agree we need to address this issue. We've been looking to add a hidden input with the select, which will hold the select's value. On form submit the input's value will be posted and mimic a native select. |
In case someone is looking for an immediate solution, this is what I did:
Essentially I'm adding a hidden input inside of the select menu markup. Then automatically hook to the |
@nikolov-tmw thanks for sharing, suggestion: rename |
@aaronhudon good point - I just figured to follow suit. Updated the sample code above. I do plan on switching to the official implementation whenever it comes out 🙂 |
I think the native CSS element got a better UX on mobile devices |
Thanks for all the input. We've talked with design and decided to revert back to using the |
Version 0.30.0 has removed the ability to use MDC select with a native form input
<select>
.Please advise best practice on how to use the MDC select with the browser's native select element.
Current documentation states:
The text was updated successfully, but these errors were encountered: