Support invoking radio action handlers on click in config form actions.
Review Request #6161 — Created July 28, 2014 and submitted — Latest diff uploaded
Unlike a checkbox, a second click on a radio input won't trigger a
'change' event, since you can't uncheck a radio input without clicking
on a different radio input. This made it impossible to respond to click
events (which I have a need for in another change -- a "Custom" radio
input entry that invokes a dialog).To get notified on a click event, actions can set
dispatchOnClick: true
on the action. Clicking the radio or its label
will then result in the action handler being called, even if the radio
is already checked.Since the browser will fire both a change and a click event, and there's
nothing we can do about that, we need to usedebounce()
to ensure the
handler is only called once.
In another change, I added an action with
dispatchOnClick: true
.The radio button, when already checked, would trigger my action handler
on click, just once.When not checked, clicking it would also trigger my action handler, just once.
No repeated events.