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
If I'm rendering two instances of the widget on the page, I've found that only the second instance that was rendered will respond to callbacks.
I'm initializing them from two separate instances of a Stimulus controller. In short, there are two elements on the page that each have a data-controller attribute. That tells Stimulus to mount an instance of a controller onto them.
When the controllers connect, they each create a new TimekitBooking() and initialize it with similar configuration. Part of this configuration is a set of callbacks that call methods on the controller instance.
I'd expect that if two widgets were initialized with separate callbacks, each widget's callbacks would run when the corresponding widget receives the event. But it seems as though only the most recently initialized instance of the widget runs the callbacks.
The text was updated successfully, but these errors were encountered:
If I'm rendering two instances of the widget on the page, I've found that only the second instance that was rendered will respond to callbacks.
I'm initializing them from two separate instances of a Stimulus controller. In short, there are two elements on the page that each have a
data-controller
attribute. That tells Stimulus to mount an instance of a controller onto them.When the controllers connect, they each create a
new TimekitBooking()
and initialize it with similar configuration. Part of this configuration is a set of callbacks that call methods on the controller instance.I'd expect that if two widgets were initialized with separate callbacks, each widget's callbacks would run when the corresponding widget receives the event. But it seems as though only the most recently initialized instance of the widget runs the callbacks.
The text was updated successfully, but these errors were encountered: