Skip to content

Commit

Permalink
Account for the first option (or any/all options) potentially being d…
Browse files Browse the repository at this point in the history
…isabled
  • Loading branch information
cee-chen committed Aug 25, 2021
1 parent 1e23559 commit 9566eed
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/components/form/super_select/super_select.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,10 @@ export class EuiSuperSelect<T extends string> extends Component<
focusSelected();
}
} else {
this.focusItemAt(0);
const firstFocusableOption = this.props.options.findIndex(
({ disabled }) => disabled !== true
);
this.focusItemAt(firstFocusableOption);
}
});
};
Expand Down

0 comments on commit 9566eed

Please sign in to comment.