Native html form support for `Select`
See original GitHub issueSince Select
doesn’t render a native select
element, it doesn’t works with the native html form
element.
Solution:
Add a visually hidden select
element inside Select
.
Problem:
Native select
element only accept string value, this means we have to remove support for object
value in Select
and only accept string
value.
Issue Analytics
- State:
- Created a year ago
- Comments:8
Top Results From Across the Web
The Past, Present And Future Of Native HTML Form Controls
In this article, Stephanie dives into the past by going back to the beginning of HTML and tracing the evolution of form controls...
Read more ><select>: The HTML Select element - HTML - MDN Web Docs
The <select> HTML element represents a control that provides a ... For further examples, see The native form widgets: Drop-down content.
Read more >HTML select tag - W3Schools
The <select> element is most often used in a form, to collect user input. ... The <select> tag also supports the Global Attributes...
Read more >Forms in HTML documents - W3C
Users generally "complete" a form by modifying its controls (entering text, selecting menu items, etc.), before submitting the form to an agent for...
Read more >How to Create a Placeholder for an HTML5 <select> Box
Styling HTML form fields, mainly <select> fields with CSS has always been ... First, you need to create your select items with the...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Yeah, I think it depends on the philosophy of the library. In this case, where it follows a more composed building blocks approach, I think supporting objects in this way isn’t needed.
Unless I’m misunderstanding something, with this approach, the user must have a mapping of
option.id -> option
in order to retrieveoption
using the value received inonChange
. If you add something likecompareFn
, then you could also directly return the object to the user inonChange
:But this is not a deal-breaker, and there is definitely benefit in keeping things simple.