Conversation
74c4a25 to
b58d5e2
Compare
| prop.opts[:required] -> values | ||
| opts[:required] -> values | ||
| true -> [{"nil", "__NIL__"} | values] | ||
| end |
There was a problem hiding this comment.
I wonder if it's better to just return [] if :values is a range. This way we'll have a text input instead of a select. It would be weird to have a select with all values of a large range, e.g. 1..1000.
Another approach would be to check the number of values, something like using a select if the number of items Is <= 10 and leaving as a text input if it's > 10. WDYT?
There was a problem hiding this comment.
its a good point @msaraiva. I had considered it but did not have a good solution, this seems like a reasonable approach. I would possibly make it 20-25 rather than 10 though. Sound good?
There was a problem hiding this comment.
I'm ok with that. Just make sure you try it out to see if it doesn't affect usability badly. I mean, I'd rather type 16 myself than look for a 16 item in a 20-sized list :)
There was a problem hiding this comment.
yea i'll see what the UX looks like. my thought was that 10 might be too small. Looking for that sweet spot 🍯
There was a problem hiding this comment.
Ideally, we could have an editable select similar to https://vue-select.org/ or use a <input> + <datalist> instead of a <select>.
|
I'm gonna hold off on updates to this one until we get my other PR in. |
Following surface-ui/surface#355 this PR adds support for ranges as prop
:values. Note that I'm not sure how to test this outside of writing an example component. Suggestions are welcome :)