I created a Dropdown list using Semantic-UI-React to let the user select colors.
The code is as follows.
import React, { Component } from 'react';
import { Dropdown } from 'semantic-ui-react';
const colorOptions = [{
text: 'red',
value: 'red'
}, {
text: 'blue',
value: 'blue'
}, {
text: 'custom',
value: 'custom'
}];
const Foo = () => (
<Dropdown
placeholder='color'
search
selection
options={colorOptions} />
)
export default Foo
Suppose that the current selected color is red. Now the user clicks on custom. Then a dialog will show`` up with more colors. And there are two buttons in the dialog. OK and Cancel.
What I want is that, when the user clicks on Cancel, the selected color would revert back to the previous one, red, instead of custom. Could it be done with Semantic-UI-react?
