Skip to content

Commit 9566eed

Browse files
committed
Account for the first option (or any/all options) potentially being disabled
1 parent 1e23559 commit 9566eed

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

src/components/form/super_select/super_select.tsx

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,10 @@ export class EuiSuperSelect<T extends string> extends Component<
137137
focusSelected();
138138
}
139139
} else {
140-
this.focusItemAt(0);
140+
const firstFocusableOption = this.props.options.findIndex(
141+
({ disabled }) => disabled !== true
142+
);
143+
this.focusItemAt(firstFocusableOption);
141144
}
142145
});
143146
};

0 commit comments

Comments
 (0)