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
I had the same problem, drag/drop elements with a stimulus useTransition controller on it. Which results in disconnect/connect. Which makes the useTransaction fail the next time (double enter/leave events).
Added the disconnect sample from above, which solves the problem. (Thanks @nflorentin)
Though I don't think this is a clean solution, maybe add disconnectUseTransition to the library and documentation? (At the moment you need to have the knowledge that enter/leave and toggleTransition properties are being used).
But.. it's still beta, so I guess improvements are coming ☺️
Hi,
The documentation show the use of
useTransition
in theconnect
function of the stimulus controller.Doing that, I noticed that the
enter/leave/toggleTransition
callbacks pill up when the stimulus controller is connected multiple times. Example:disconnect()
andconnect()
from my controller because I detect amorph
enter/leave/toggleTransition
on click on my element (so my dropdown is not working anymore)It seems that useTransition does not support being connected multiple times.
I tried 2 things that seem to work but I don't know which one is better:
useTransition
fromconnect
function and add the following lines in adisconnect
function:useTransition
ininitialize
functionMy main goal is to avoid memory leak.
Thanks for your work! and your future help :-)
The text was updated successfully, but these errors were encountered: