Skip to content

Commit

Permalink
Merge pull request #30958 from namhihi237/fix-29675-selector-hightlight
Browse files Browse the repository at this point in the history
  • Loading branch information
dangrous authored Nov 14, 2023
2 parents 5f5fe0d + e4244af commit 5a00a8f
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 7 deletions.
8 changes: 2 additions & 6 deletions src/components/ValuePicker/ValueSelectorModal.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,6 @@ const propTypes = {
/** Whether the modal is visible */
isVisible: PropTypes.bool.isRequired,

/** Current value selected */
currentValue: PropTypes.string,

/** Items to pick from */
items: PropTypes.arrayOf(PropTypes.shape({value: PropTypes.string, label: PropTypes.string})),

Expand All @@ -32,15 +29,14 @@ const propTypes = {
};

const defaultProps = {
currentValue: '',
items: [],
selectedItem: {},
label: '',
onClose: () => {},
onItemSelected: () => {},
};

function ValueSelectorModal({currentValue, items, selectedItem, label, isVisible, onClose, onItemSelected}) {
function ValueSelectorModal({items, selectedItem, label, isVisible, onClose, onItemSelected}) {
const [sectionsData, setSectionsData] = useState([]);

useEffect(() => {
Expand Down Expand Up @@ -70,7 +66,7 @@ function ValueSelectorModal({currentValue, items, selectedItem, label, isVisible
<SelectionList
sections={[{data: sectionsData}]}
onSelectRow={onItemSelected}
initiallyFocusedOptionKey={currentValue}
initiallyFocusedOptionKey={selectedItem.value}
shouldStopPropagation
/>
</ScreenWrapper>
Expand Down
1 change: 0 additions & 1 deletion src/components/ValuePicker/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,6 @@ function ValuePicker({value, label, items, placeholder, errorText, onInputChange
</View>
<ValueSelectorModal
isVisible={isPickerVisible}
currentValue={selectedLabel || placeholder || ''}
label={label}
selectedItem={selectedItem}
items={items}
Expand Down

0 comments on commit 5a00a8f

Please sign in to comment.