i I’ve run into this a few times now: I just want to add an invalid
event handler to a form, so I can show a notification when the form is invalid. Nothing out of the ordinary. But for some reason, even when the form is valid, the notification still shows up.
After some digging, I traced it back to a module that includes a required field. This field correctly influences the form’s overall invalid
state, as expected. However, this doesn’t seem to be reflected in the event handler. In other words, the invalid
event is triggered even though the form appears valid. It’s as if the event handler relies on a separate “source of truth” instead of just referencing the form’s actual validity state.
It’s a frustrating issue—not just because it's tricky to debug, but especially because the form's submit flow now breaks. I can’t rely on the submit
event to trigger a save query anymore, since it doesn’t fire when the form is (falsely) considered invalid.
My current workaround? I’ve removed the event handlers entirely and call the save query directly from the submit button. It works, but it’s clunky and adds unnecessary complexity. Definitely not ideal.