We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents a6bea3d + b4173fc commit 839c067Copy full SHA for 839c067
src/dropdown.ts
@@ -321,7 +321,7 @@ export class Dropdown extends Component<DropdownOptions> implements Openable {
321
else if (Utils.keys.ENTER.includes(e.key) && this.isOpen) {
322
// Search for <a> and <button>
323
const focusedElement = this.dropdownEl.children[this.focusedIndex];
324
- const activatableElement = <HTMLElement>focusedElement.querySelector('a, button');
+ const activatableElement = <HTMLElement>focusedElement?.querySelector('a, button');
325
// Click a or button tag if exists, otherwise click li tag
326
if (!!activatableElement) {
327
activatableElement.click();
0 commit comments