Skip to content

Commit

Permalink
Restore part of code for Selenium
Browse files Browse the repository at this point in the history
  • Loading branch information
kyoshino committed Jan 10, 2024
1 parent 47cac78 commit 1f1cbd3
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion js/components/select.js
Original file line number Diff line number Diff line change
Expand Up @@ -609,14 +609,21 @@ class BzSelectElement extends HTMLElement {
}

/**
* Called whenever the {@link #dialog} is clicked. Hide the dropdown list.
* Called whenever the {@link #dialog} is clicked. Hide the dropdown list, and select a new option
* if possible. Usually {@link #onListboxMouseUp} handles selection, but the code is needed to
* pass the Selenium tests using `click` events.
* @param {MouseEvent} event `click` event.
*/
#onDialogClick(event) {
const { target } = event;

if (target === this) {
this.#hideDropdown();
} else if (target.matches('bz-option:not([disabled])')) {
this.#hideDropdown();
this.#canDispatchEvent = true;
this.value = target.value;
this.#canDispatchEvent = false;
}
}

Expand Down

0 comments on commit 1f1cbd3

Please sign in to comment.