react-textselect icon indicating copy to clipboard operation
react-textselect copied to clipboard

Active selection should be by name, not numerical index

Open Tectract opened this issue 8 years ago • 0 comments

Hi there,

I noticed with this plugin, you need to specify:

options={['option0', 'option1', 'option2']}
active={this.state.selectedOption}

Here, you actually need to specify the numerical INDEX of the selection you want, which means I need to do some funky logic to get the indices at runtime. It would be much nicer if I could specify instead "option1" instead of "1" as the active entry here instead.

Tectract avatar Jun 15 '17 00:06 Tectract