You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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 usesetTimeout(()=>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
The text was updated successfully, but these errors were encountered:
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 usesetTimeout(()=>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
The text was updated successfully, but these errors were encountered: