Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix regression with default option selection #3426

Merged
merged 1 commit into from
Jun 9, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions src/components/OptionsSelector.js
Original file line number Diff line number Diff line change
Expand Up @@ -114,10 +114,6 @@ class OptionsSelector extends Component {
* @param {SyntheticEvent} e
*/
handleKeyPress(e) {
if (this.props.disableArrowKeysActions) {
return;
}

// We are mapping over all the options to combine them into a single array and also saving the section index
// index within that section so we can navigate
const allOptions = _.reduce(this.props.sections, (options, section, sectionIndex) => (
Expand All @@ -128,6 +124,10 @@ class OptionsSelector extends Component {
}))]
), []);

if (this.props.disableArrowKeysActions && e.nativeEvent.key.startsWith('Arrow')) {
return;
}

switch (e.nativeEvent.key) {
case 'Enter': {
this.selectRow(allOptions[this.state.focusedIndex]);
Expand Down