ibm-js / deliteful

Multichannel (desktop/mobile) UI Custom Elements Library
http://ibm-js.github.io/deliteful
Other
70 stars 36 forks source link

ComboPopup: cancelHandler does not clear selected items, if any. #677

Open brunano21 opened 7 years ago

brunano21 commented 7 years ago

Valid only for Combobox's selectionMode = multiple Whenever the user opens up the dropdown and selected some items, if he hits the Cancel button, the selection made is not cleared.

Potential fix would be to clear reset the combo.list.selectedItems to an empty array ([]) and then call combo._validateMultiple(true), so the widget state gets update accordingly.

This bug has been introduced by 785de84.

wkeese commented 7 years ago

Note that I'm not adding the [bug] label because this regression wasn't (and will not be) in any official release. It broke after 0.8 and will be fixed before 0.9.

wkeese commented 6 years ago

Actually, this fix isn't quite right. The "Cancel" button is clearing the selection, rather than restoring the selection to what it was before the dropdown was opened.

But this begs the question: Why have a cancel button at all? There's no button on desktop that lets you revert to the state before the dropdown was opened.