Skip to content

Commit

Permalink
Merge branch 'HIRANO-Satoshi-patch-2' into v2-dev
Browse files Browse the repository at this point in the history
  • Loading branch information
wuda-io committed Feb 24, 2025
2 parents a6bea3d + b4173fc commit 839c067
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/dropdown.ts
Original file line number Diff line number Diff line change
Expand Up @@ -321,7 +321,7 @@ export class Dropdown extends Component<DropdownOptions> implements Openable {
else if (Utils.keys.ENTER.includes(e.key) && this.isOpen) {
// Search for <a> and <button>
const focusedElement = this.dropdownEl.children[this.focusedIndex];
const activatableElement = <HTMLElement>focusedElement.querySelector('a, button');
const activatableElement = <HTMLElement>focusedElement?.querySelector('a, button');
// Click a or button tag if exists, otherwise click li tag
if (!!activatableElement) {
activatableElement.click();
Expand Down

0 comments on commit 839c067

Please sign in to comment.