-
Notifications
You must be signed in to change notification settings - Fork 2.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Recommend allowing dropdown to close after button clicked & dropdown is open #36
Comments
Not 100% working actually... Working on it... |
My old solution didn't work b/c you would sometimes have to click the dropdown button twice to get it to open. New solution in the next comment ;) |
The next idea I had (which I'm going to stick with for now) is to add a unique
Note: I also added |
Hello @Beamanator , And thank you for your interest in using our product. Best, |
material-kit-react/src/components/CustomDropdown/CustomDropdown.jsx
Line 33 in fbcd45c
I implemented this by making a new variable in the state called
buttonToggle
, defaulting it tofalse
in the constructor, then changing it inhandleClick
like this:Even when I tried just doing
this.setState({ open: !this.state.open })
, thehandleClose
method was being called before thehandleClick
method, so just flipping theopen
state variable wasn't enough.The text was updated successfully, but these errors were encountered: