Skip to content
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

useTransition: options being applied to a different controller #173

Open
ariesandrada opened this issue Oct 14, 2021 · 0 comments
Open

useTransition: options being applied to a different controller #173

ariesandrada opened this issue Oct 14, 2021 · 0 comments

Comments

@ariesandrada
Copy link

ariesandrada commented Oct 14, 2021

I'm currently using hotwire (turbo and stimulus). I'm using useTransition with the default options to show/hide a dropdown as part of the page layout and it has its own controller. Then I have an element where I transition between 2 states so I used useTransition with options hiddenClass: false and removeToClasses: false and this is in its own controller as well.

The problem I'm having is when I navigate away from the page with the element that switches states, my dropdown in the page layout just shows up by default. It seems that the hidden class isn't being applied to it anymore and the toClasses are being retained as well. This made me think that the options I used in my state switching element gets somehow applied to the dropdown in my page layout.

When I explicitly specified those options in my dropdown, it seems to have solved the problem.

Hopefully you'd be able to understand my description of the problem. Thanks!

@marcoroth marcoroth changed the title useTransition options being applied to a different controller useTransition: options being applied to a different controller Aug 6, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant