Skip to content

How to open a dropdown menu automatically #782

Answered by shyakadavis
rhscjohn-dev asked this question in Help
Discussion options

You must be logged in to vote

Hi @rhscjohn-dev ;

  • So, if you "just" want it open by default, then you need to bind that open prop to a state variable.
  • Regardless of whether you don't want to display the Trigger component, you still need it present so that the Content knows which place to anchor itself unto, and as a hack/workaround, just use css to hide it. Couple of problems with this, though:
    • Once you click outside the content, it'll close and you won't have a trigger to re-open it. So, be sure to set the closeOnOutsideClick prop to false.
    • If you click on any item in the content body, it'll close the dropdown-menu, again, with no trigger to re-open. So, be sure to set the closeOnItemClick prop to false.

Simply d…

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@rhscjohn-dev
Comment options

Answer selected by rhscjohn-dev
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Help
Labels
None yet
2 participants