ampersand-dom-bindings
ampersand-dom-bindings copied to clipboard
Changing a property bound to a checked property of a checkbox within an event handler can break.
If e.preventDefault() is called in a checkbox click handler, and then a property is changed which is bound to a booleanAttribute the binding doesn't work. This is because e.preventDefault will revert the change.
Proposed fix is to wrap:
https://github.com/AmpersandJS/ampersand-dom-bindings/blob/master/ampersand-dom-bindings.js#L140
in a setTimeout 0 if we're changing the checked attribute.