React-select: if I don't want to filter options while in multi mode

Created on 1 Jul 2017  路  9Comments  路  Source: JedWatson/react-select

Instead of filter options in 'multi' mode, if we have to rewrite filterOptions, we may also want to do something to the selected options ((e.g apply a style, remove option if click again). Therefore, pass valueArray and removeValue() to menuRenderer would be needed.

Most helpful comment

yes, I think it's more like a feature/enhancement, just like what pr #1731 did, to add more flexibility for the options. when we use multiselect mode, we may not always want to filter the selected options. Therefore, making menuRenderer more flexible would be a good direction.

Below is the example that I want to leverage menuRenderer to acheive. But actually I can't do it because the lack of valueArray and removeValue() in menuRenderer.
screen shot 2017-07-01 at 10 34 52 pm

All 9 comments

Hi @kcliu can you give us a bit more information? Are you proposing a feature?

yes, I think it's more like a feature/enhancement, just like what pr #1731 did, to add more flexibility for the options. when we use multiselect mode, we may not always want to filter the selected options. Therefore, making menuRenderer more flexible would be a good direction.

Below is the example that I want to leverage menuRenderer to acheive. But actually I can't do it because the lack of valueArray and removeValue() in menuRenderer.
screen shot 2017-07-01 at 10 34 52 pm

This seems like a pretty obvious enhancement. I have an identical mock-up that I'm trying to recreate.

Hi @kcliu i see. But this doesn鈥檛 look like a select component you are looking for a menu component, right?

@agirton Nope, the mock-up is just for demonstration.

+1

I too am interested in being able to render the menu in the way described by @kcliu kcliu as it's much more mobile friendly.

Is seems like this PR might fix this, and it's only a tiny change to pass along the valueArray.

Hi @newswim my concern is some people may be expecting this old behavior, so it's best to wait till after 1.0 is released.

I've stepped through the code and this should be safe (not make a difference) because the function signature remains the same, and by default selected options aren't being passed to the menuRenderer anyway. So I've merged that PR, which (in combination with the new removeOnSelect prop in PR #1891) will let you do what you're after.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

Meesam picture Meesam  路  3Comments

juliensnz picture juliensnz  路  3Comments

x-yuri picture x-yuri  路  3Comments

yrabinov picture yrabinov  路  3Comments

MindRave picture MindRave  路  3Comments