Skip to content

Commit

Permalink
Merge pull request #33667 from Pujan92/fix/33654
Browse files Browse the repository at this point in the history
Fix: Search - Nothing happens when hitting Enter key on the selected user
(cherry picked from commit f8d5cd4)
  • Loading branch information
Beamanator authored and OSBotify committed Dec 27, 2023
1 parent 04cbb08 commit 9747fe8
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/components/OptionRow.js
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ function OptionRow(props) {
<Hoverable>
{(hovered) => (
<PressableWithFeedback
testID={props.keyForList}
nativeID={props.keyForList}
ref={(el) => (pressableRef.current = el)}
onPress={(e) => {
if (!props.onSelectRow) {
Expand Down
2 changes: 1 addition & 1 deletion src/components/OptionsSelector/BaseOptionsSelector.js
Original file line number Diff line number Diff line change
Expand Up @@ -303,7 +303,7 @@ class BaseOptionsSelector extends Component {
}

selectFocusedOption(e) {
const focusedItemKey = lodashGet(e, ['target', 'attributes', 'data-testid', 'value']);
const focusedItemKey = lodashGet(e, ['target', 'attributes', 'id', 'value']);
const focusedOption = focusedItemKey ? _.find(this.state.allOptions, (option) => option.keyForList === focusedItemKey) : this.state.allOptions[this.state.focusedIndex];

if (!focusedOption || !this.props.isFocused) {
Expand Down
2 changes: 1 addition & 1 deletion src/components/SelectionList/BaseListItem.js
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ function BaseListItem({
hoverStyle={styles.hoveredComponentBG}
dataSet={{[CONST.SELECTION_SCRAPER_HIDDEN_ELEMENT]: true}}
onMouseDown={shouldPreventDefaultFocusOnSelectRow ? (e) => e.preventDefault() : undefined}
testID={keyForList}
nativeID={keyForList}
>
<View
style={[
Expand Down
2 changes: 1 addition & 1 deletion src/components/SelectionList/BaseSelectionList.js
Original file line number Diff line number Diff line change
Expand Up @@ -238,7 +238,7 @@ function BaseSelectionList({
};

const selectFocusedOption = (e) => {
const focusedItemKey = lodashGet(e, ['target', 'attributes', 'data-testid', 'value']);
const focusedItemKey = lodashGet(e, ['target', 'attributes', 'id', 'value']);
const focusedOption = focusedItemKey ? _.find(flattenedSections.allOptions, (option) => option.keyForList === focusedItemKey) : flattenedSections.allOptions[focusedIndex];

if (!focusedOption || focusedOption.isDisabled) {
Expand Down

0 comments on commit 9747fe8

Please sign in to comment.