Active-CSS / active-css

The epic event-driven browser language for UI with functionality in one-liner CSS. Over 100 incredible CSS commands for DOM manipulation, ajax, reactive variables, single-page application routing, and lots more. Could CSS be the JavaScript framework of the future?
https://activecss.org
Other
42 stars 7 forks source link

When await is used with ajax, it ignores subsequent events of the same type further down the page #271

Closed bob2517 closed 1 year ago

bob2517 commented 2 years ago

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.

bob2517 commented 2 years 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.

bob2517 commented 1 year ago

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.