Replies: 2 comments 2 replies
-
@dakur, just to be clear, is this the functionality you were hoping to condense into a single prop? const [ isMenuOpen, setIsMenuOpen ] = useState();
return <Select
onMenuOpen={() => setIsMenuOpen(true)}
onMenuClose={() => setIsMenuOpen(false)}
onKeyDown={e => !isMenuOpen && e.code === 'Enter' && event.preventDefault() }
{...otherProps}
/> |
Beta Was this translation helpful? Give feedback.
2 replies
-
In most cases the consuming project doesn't need to provide |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
In addition to #3823 which solves problem of submitting whole form when menu is opened and no options available, I would welcome possibility of preventing Enter key in menu-closed state as well.
Currently, I can work-around it with
onMenuOpen
,onMenuClose
and local variable, but I suggest it is part of the API.Beta Was this translation helpful? Give feedback.
All reactions