Closed bob2517 closed 1 year ago
The existing workaround for the moment while I fix this, when using await with ajax, is to either put all commands in the same event, or trigger them from inside there.
Looking at this with new eyes, it may be useful to leave this as it is. If I "fix" this, we lose a simultaneous event handling possibility. Everything for an element would be forced to happen after an awaited ajax call.
On second thoughts then, I'm going to close this for now and label it as a red herring. If minds get changed on this then I'll re-open it. The issue only came up once. If it comes up again, maybe there is a better solution than forcing the event queue to involve other events.
As per title.
The problem looks like it's to do with the way the core rejoins the command flow. The exit that occurs during pause state ignores subsequent events, and when it rejoins the command flow it doesn't then continue with remaining events on the same element.
It needs to remember if there are elements of the same event type, like click, and queue those.
And also when the await hits, it needs to really continue where it left it, and then bubble up.
It's probably re-joining the command queue too late on the chain. To solve this, either re-join higher up, or temporarily store the remaining events, but that might get a bit messy.
It's a little complex, but that seems to be the indicated behaviour.