It focuses on DropDownMenuTrigger when you close the menu #3105
Unanswered
bhubavenski
asked this question in
Help
Replies: 1 comment
-
Noticed the same and ended here while Googling. Found out you just need to add https://www.radix-ui.com/primitives/docs/components/dropdown-menu#content
Hope this fixes your issue 👍 |
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
-
Hello, folks! From the past two days I was fighting with my textarea element to find why it wont focus when I call the .focus() method on it and just now I saw why.
After long searching the net, I found a useful article which tells how to know which part of the page gets focused and then I saw that when I close the dropdown menu it triggers focus on its dropDownMenuTrigger element, which under the hood is a Button element.
And thats how I found why my textarea gets focused for 0.3 seconds and then it blurs. So how I can prevent this behaviour. For now the only solution I found is to use
setTimeout(()=>textarea.focus(), 300)
.I am not exactly sure why I have to wait, I think its maybe because there is an animation of closing the menu, which I should wait. If there is a better solution, please reach to me
Beta Was this translation helpful? Give feedback.
All reactions