Comparing selected option in the dropdown with other options!

<select
options={[{label:"A",value:2,isChild:0},
        {label:"B",value:5,isChild:0},
        { label:"C",value:3,isChild:0} ]}
value = { this.state.selectedOptions}
isSearchable={false}
isDisabled={this.state.isEdit === true}
noOptionsMessage={() => null}
onChange = {this.state.selectedSystems !== null ? this.onViewAll : null}>
 </Select

I want to compare the selected option with the option that am gonna select. Let’s say I selected “A” from the dropdown, and when I want to change the option to “B”, I should get a popup saying “Do you want to change the option” with “OK” and “Cancel”. It’s kind of urgency, Thanks in advance!

I’ve edited your post for readability. When you enter a code block into a forum post, please precede it with a separate line of three backticks and follow it with a separate line of three backticks to make it easier to read.

You can also use the “preformatted text” tool in the editor (</>) to add backticks around text.

See this post to find the backtick on your keyboard.
Note: Backticks (`) are not single quotes (’).

This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.