Open massette opened 1 month ago
As described on the Twine Discord, this looks like a race condition between two instances of changeContent()
, one triggered by the cycling link, one by the user-added listener.
The sequence seems to be:
changeContent()
moving the live elements off-screen and replacing them with a static copy without event handlerschangeContent()
moving the static HTML elements (without listeners) off-screen to it's own bufferchangeContent()
resolves, moving the original elements back on-screenchangeContent()
resolves, moving the handler-less copy back on-screenIt feels like either changeContent()
needs a queue, or multiple instances called on the same element need a way to share the off-screen buffer rather than recreating it.
Describe the bug Concurrent calls to
<content-element>.changeContent
permanently remove all event handlers from the element.To Reproduce Add the following passage to a story and click the cycling link.
Expected behavior Event handlers are consistently restored after
changeContent
triggers a transition, regardless of the state of the page when it is called.Stories and screenshots changeContent-issue.zip
Environment Problem observed on Windows 11 version 23H2 in Microsoft Edge version 128.0.2739.79.