diff --git a/src/components/OptionRow.js b/src/components/OptionRow.js index b6628d7444ab..4bc4285a693e 100644 --- a/src/components/OptionRow.js +++ b/src/components/OptionRow.js @@ -76,6 +76,8 @@ const propTypes = { /** Whether to wrap large text up to 2 lines */ isMultilineSupported: PropTypes.bool, + /** Key used internally by React */ + keyForList: PropTypes.string, style: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.object), PropTypes.object]), ...withLocalizePropTypes, @@ -99,6 +101,7 @@ const defaultProps = { shouldHaveOptionSeparator: false, shouldDisableRowInnerPadding: false, shouldPreventDefaultFocusOnSelectRow: false, + keyForList: undefined, }; function OptionRow(props) { @@ -163,6 +166,7 @@ function OptionRow(props) { {(hovered) => ( (pressableRef.current = el)} onPress={(e) => { if (!props.onSelectRow) { diff --git a/src/components/OptionsList/BaseOptionsList.js b/src/components/OptionsList/BaseOptionsList.js index d22df00bd0b3..bcd990a6909f 100644 --- a/src/components/OptionsList/BaseOptionsList.js +++ b/src/components/OptionsList/BaseOptionsList.js @@ -201,6 +201,7 @@ function BaseOptionsList({ return ( option.keyForList === focusedItemKey) : this.state.allOptions[this.state.focusedIndex]; if (!focusedOption || !this.props.isFocused) { return;