Skip to content

Commit e32f9ca

Browse files
committed
fix: stop propagation on esc in select picker for modal
1 parent 5687b2d commit e32f9ca

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

src/Shared/Components/SelectPicker/SelectPicker.component.tsx

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -360,8 +360,12 @@ const SelectPicker = <OptionValue, IsMulti extends boolean>({
360360
e.preventDefault()
361361
}
362362

363-
if (e.key === 'Escape' && !selectRef.current.props.menuIsOpen) {
364-
selectRef.current.blur()
363+
if (e.key === 'Escape') {
364+
e.stopPropagation()
365+
366+
if (!selectRef.current.props.menuIsOpen) {
367+
selectRef.current.blur()
368+
}
365369
}
366370

367371
onKeyDown?.(e)

0 commit comments

Comments
 (0)