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
  • Loading branch information
Beamanator authored Dec 27, 2023
2 parents 9e81447 + 3b7fa06 commit f8d5cd4
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 f8d5cd4

Please sign in to comment.