question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Option to enable standard multi-select behavior?

See original GitHub issue

I was wondering if you think it was a good idea to enable standard multi-select behavior in react-select, when the multi prop is set to true. I.e., send the selected values, with the key repeated for each value in the query string: foo[]=bar&foo[]=baz. The way this could work is that instead of the hidden text field, a select field is maintained, which mirrors the selected values as selected options. This would have to be hidden using CSS, instead of the type="hidden" attribute. It would also mean more overhead in terms of performance. That’s why I think not having this as a default but as an option would be better.

Issue Analytics

  • State:closed
  • Created 8 years ago
  • Comments:5 (1 by maintainers)

github_iconTop GitHub Comments

1reaction
gwyneplainecommented, Sep 21, 2018

resolved, we now have a hidden input that serializes selected values (both multi and single) that operates as expected with native form elements.

0reactions
brudersteincommented, Aug 13, 2015

That’s a very good point. Enabling this by setting the name property seems like a good way to ensure this isn’t done unnecessarily.

I can see both sides of the “do we want to support this” argument though.

On Thu, Aug 13, 2015 at 2:43 PM, Helge Rausch notifications@github.com wrote:

I don’t think using an actual select is that much more complicated. Instead of inputs you use options, have them all selected and wrap them in a select:

var selectedOptions = this.state.values.map(option =>

<option style="display: none;" value={option.value} selected="selected" />) React.createElement('select', { name: this.props.name }, selectedOptions);

— Reply to this email directly or view it on GitHub https://github.com/JedWatson/react-select/issues/339#issuecomment-130656599 .

Read more comments on GitHub >

github_iconTop Results From Across the Web

Multi-Select Picklist Value ordering behavior - Salesforce Help
Multi-Picklist fields allow you to select multiple values on your records for various use cases. You have the ability to define values on...
Read more >
Multi-Select Option Sets (Choices) in D365 CRM Solutions
Multi-select option sets, now known as choice columns, in Dynamics 365 CRM solutions can streamline data entry. Here's how to set them up....
Read more >
Should selected options be removed from single- and multi ...
My question now is: Should the option(s) the user has already selected (a) still be shown and highlighted in the list or should...
Read more >
Bootstrap Multiselect Examples - CodeHim
Simulate single selections using checkboxes. The behavior will be similar to a multiselect with radio buttons except that the selected option can be...
Read more >
How to enable filter option for multi-select drop-down fields?
On the Settings page, click on the Customize app and select the Master Layout. Drag and drop the Multi-Select attribute from the right...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found