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: Remain focus when selecting option #20736

Merged
merged 14 commits into from
Jul 5, 2023
2 changes: 2 additions & 0 deletions src/components/OptionRow.js
Original file line number Diff line number Diff line change
Expand Up @@ -185,6 +185,8 @@ class OptionRow extends Component {
accessibilityRole="button"
hoverDimmingValue={1}
hoverStyle={this.props.hoverStyle}
focusStyle={this.props.hoverStyle}
onMouseDown={this.props.onRowMouseDown}
>
<View style={sidebarInnerRowStyle}>
<View style={[styles.flexRow, styles.alignItemsCenter]}>
Expand Down
1 change: 1 addition & 0 deletions src/components/OptionsList/BaseOptionsList.js
Original file line number Diff line number Diff line change
Expand Up @@ -174,6 +174,7 @@ class BaseOptionsList extends Component {
isDisabled={isDisabled}
shouldHaveOptionSeparator={index > 0 && this.props.shouldHaveOptionSeparator}
shouldDisableRowInnerPadding={this.props.shouldDisableRowInnerPadding}
onRowMouseDown={this.props.onRowMouseDown}
/>
);
}
Expand Down
6 changes: 6 additions & 0 deletions src/components/OptionsSelector/BaseOptionsSelector.js
Original file line number Diff line number Diff line change
Expand Up @@ -337,6 +337,12 @@ class BaseOptionsSelector extends Component {
contentContainerStyles={[safeAreaPaddingBottomStyle, ...this.props.contentContainerStyles]}
listContainerStyles={this.props.listContainerStyles}
isLoading={!this.props.shouldShowOptions}
onRowMouseDown={(e) => {
if (!e || !this.textInput.isFocused()) {
return;
}
e.preventDefault();
}}
/>
);
return (
Expand Down