fix issue with dropdown on Chrome
This commit is contained in:
@@ -125,7 +125,6 @@ export class SeList extends HTMLElement {
|
||||
connectedCallback () {
|
||||
const currentObj = this;
|
||||
this.$dropdown.addEventListener('selectedindexchange', (e) => {
|
||||
e.preventDefault();
|
||||
if (e?.detail?.selectedIndex !== undefined) {
|
||||
const value = this.$dropdown.selectedItem.getAttribute('value');
|
||||
const closeEvent = new CustomEvent('change', { detail: { value } });
|
||||
@@ -133,6 +132,12 @@ export class SeList extends HTMLElement {
|
||||
currentObj.value = value;
|
||||
}
|
||||
});
|
||||
this.$dropdown.addEventListener('close', (e) => {
|
||||
/** @todo: with Chrome, selectedindexchange does not fire consistently
|
||||
* unless you forec change in this close event
|
||||
*/
|
||||
this.$dropdown.selectedIndex = this.$dropdown.currentIndex;
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user