Hey there!
I encountered an issue with a dropdown feature in my project. When I click the button to trigger the dropdown, it only works on the second click, not the first.
Steps to Reproduce:
- Click the show/hide button.
- Observe that the dropdown does not activate on the first click but does on the second click.
Setup Details:
- The feature is supposed to work by setting the class
active
whenshowCalendar
is true. - Upon the first click, nothing changes. It only starts working on the second click.
- I have implemented an
onClick
event that sets a variable and toggles visibility. - The button rotates once
showCalendar
is true, indicating that the classactive
is correctly set. - The dropdown component appears after the second click.
Additional Information:
- The same setup works perfectly with other buttons.
- The calendar component should drop down and become visible when
showCalendar
is set to true. - Clicking the background should hide the dropdown as intended.
Could you please help identify why the dropdown doesn’t work on the first click and what might need to be adjusted?
Here’s a recording of whats happening: