-
-
Notifications
You must be signed in to change notification settings - Fork 423
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
Dropdown dismiss on click only works the first time #793
Comments
Same problem for me. I think the cause of this issue is in flowbite-react/src/components/Dropdown/Dropdown.tsx Lines 92 to 95 in 35e7f5b
In order to dismiss the menu, When I replaced the I hope this information helps to resolve the issue. |
@nbsp1221 Thank you for catching that! I specifically undid that change and did not realize this is a thing that happens. That is my bad. If someone wants to make a PR - please do! It should be as simple as doing exactly what @nbsp1221 did here, or something simpler to understand like, My guess is that |
This is a duplicate of #625 but I didn't realize that and the proposed solution provided here is great so we can keep the discussion here. |
@tulup-conner Hi, I understand the problem. I want to working on this problem. can you assign to me? |
…smissOnClick is true The dropdown component was not closing after after the first time it was opened and the items were clicked. The closeRequestKey was not being updated after the first render fix themesberg#793
@nigellima are you working on this one? I noticed that you created a commit with a reference to this task. :) |
Hey, yes. It's still in my local environment. But that commit in specific I will drop it, because I'm actually working on the #648 , which will solve this and some other issues related to the Dropdown component |
@nigellima all right. Thanks, I'll be waiting for your the PR. Valeu, jovem. :) |
Now the Dropdownn component is accessible by keyboard. It also adds the support to disable the trigger button. Also the dismiss on item click is fixed fix themesberg#648. fix themesberg#793. fix themesberg#539 --------- Co-authored-by: Fatemeh Paghar <paghar.fatemeh@outlook.com>
Now the Dropdown component is accessible by keyboard. Also the dismiss on item click is fixed fix themesberg#648. fix themesberg#793
Now the Dropdown component is accessible by keyboard. Also the dismiss on item click is fixed fix themesberg#648. fix themesberg#793
* feat(button.tsx): created BaseButton component This component is responsible to handle the logic of creating the button element based on the custom or default tag name * feat(dropdown.tsx): enabled Dropdown to be accessible by keyboard Now the Dropdown component is accessible by keyboard. Also the dismiss on item click is fixed fix #648. fix #793 * feat(dropdown.tsx): removed div wrapper around trigger button * feat(dropdown.tsx): moved renderTrigger function to Trigger clone element resulted from renderTrigger and attach the ref and a11y props to it * test(dropdown.tsx): updated and added more tests Resolution for dependency nwsapi was added in order to fix an issue in the tababble package * refact(floating.tsx): passed arrowRef to useBaseFloating custom hook * fix(floating.tsx): readded focus interaction * test(dropdown.tsx): added a delay in one of the test cases * docs(dropdown.tsx): added stories and documentation section * refact(dropdown.tsx): removed mergeWrapperClassName utility fn * feat(dropdown.tsx): added theme customization support for menuitem
Describe the bug
Dropdown dismiss on click only works the first time the dropdown menu is opened
To Reproduce
Expected behavior
Clicking a dropdown menu item dismisses the menu consistently
Screenshots
Screen.Recording.2023-06-03.at.11.21.02.mov
System information:
Project information:
Additional context
Add any other context about the problem here.
The text was updated successfully, but these errors were encountered: