Open brechtDR opened 7 months ago
That definitely seems like a bug to me. If an input changes, a change
event should be fired. Perhaps more nebulous would be the input
event. I can see a case for not firing that one? Not sure.
That definitely seems like a bug to me. If an input changes, a change event should be fired. Perhaps more nebulous would be the input event. I can see a case for not firing that one? Not sure.
So the change event doesn't fire for the JS API for stepUp or stepDown across all 3 engines. I agree that input shouldn't be fired as that's quite clearly about user input.
Here's the demo to show change not firing: https://jsfiddle.net/9nrp7b2u/
Also want to note that when you fire the "invoke" event, the input's value will be updated after the actual event (and thus return the previous value). this is by design, but it does make it so that triggering change event would be extra handy. Drawing a bit of a blank to explain this with words, so here is an extra demo about that (open the console, to see when i mean) https://codepen.io/utilitybend/pen/abxKpdN/5cd46990819b28e9ac6e5f88c2af73c4
Okay I'm remembering all the jank with change and input events 😅
The Open UI Community Group just discussed [invokers] Should events trigger when invoking?
, and agreed to the following:
RESOLVED: dispatch change events when an invoker changes an input value
There hasn't been any discussion on this issue for a while, so we're marking it as stale. If you choose to kick off the discussion again, we'll remove the 'stale' label.
When creating a demo with invoker buttons, I was wondering if a change event on an input should be triggered when controlling it, or just events in general if we'd like to take this further. At the moment, this doesn't happen.
The example I'm referring to is using invokers to trigger an
<input type="number" />
The example I was making: https://codepen.io/utilitybend/pen/poBLLWy/81246d701205fadefbbcc1fbe2dd72cf
Code example in short:
Should the following trigger:
Would love to hear thoughts on this. It would made my demo easier, but that's currently the only argument I have for it. Wanted to open this to the group