After selecting an Item in SinglePickerMaterialDialog and pressing "OK" the dialog box disappears. If we open the SinglePickerMaterialDialog again, it shows the first item selected by default instead of last selected item.
Tried changing the same through state as well but it's not working.
In below example, we have passed hardcoded object as "selectedItem". Still it is picking up
the 1st object (with key=0) as default selected item.
After selecting an Item in SinglePickerMaterialDialog and pressing "OK" the dialog box disappears. If we open the SinglePickerMaterialDialog again, it shows the first item selected by default instead of last selected item.
Tried changing the same through state as well but it's not working.
In below example, we have passed hardcoded object as "selectedItem". Still it is picking up the 1st object (with key=0) as default selected item.
SinglePickerMaterialDialog colorAccent = '#FD8000' title = { 'Choose Filter Option' } scrolled items = { [{ key: 0, label: 'Assigned to me123' }, { key: 1, label: 'Priority' }, { key: 2, label: 'Unassigned' }, { key: 3, label: 'Everything' }, ] } visible = { this.state.scrolledSinglePickerVisible } selectedItem = { { key: 3, label: 'Everything' } }
onCancel = { () => this.setState({ scrolledSinglePickerVisible: false }) } onOk = { result => { this.setState({ scrolledSinglePickerVisible: false }, () => {}); } } />