Skip to content

Commit 98df963

Browse files
committed
fix: keyboard navigation for select picker options
1 parent 2ee39dd commit 98df963

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

src/Shared/Components/SelectPicker/common.tsx

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -207,16 +207,18 @@ export const SelectPickerMenuList = <OptionValue,>(props: MenuListProps<SelectPi
207207
} = props
208208

209209
return (
210-
// added key here to explicitly re-render the list on input change so that the top option is rendered
211-
<components.MenuList {...props} key={inputValue}>
212-
<div className="py-4 cursor">{shouldRenderCustomOptions ? renderCustomOptions() : children}</div>
213-
{/* Added to the bottom of menu list to prevent from hiding when the menu is opened close to the bottom of the screen */}
210+
<>
211+
{/* added key here to explicitly re-render the list on input change so that the top option is rendered */}
212+
<components.MenuList {...props} key={inputValue}>
213+
<div className="py-4 cursor">{shouldRenderCustomOptions ? renderCustomOptions() : children}</div>
214+
{/* Added to the bottom of menu list to prevent from hiding when the menu is opened close to the bottom of the screen */}
215+
</components.MenuList>
214216
{!shouldRenderCustomOptions && renderMenuListFooter && (
215217
<div className="dc__position-sticky dc__bottom-0 dc__bottom-radius-4 bcn-0 dc__zi-2">
216218
{renderMenuListFooter()}
217219
</div>
218220
)}
219-
</components.MenuList>
221+
</>
220222
)
221223
}
222224

0 commit comments

Comments
 (0)