ampersand-dom-bindings icon indicating copy to clipboard operation
ampersand-dom-bindings copied to clipboard

Changing a property bound to a checked property of a checkbox within an event handler can break.

Open latentflip opened this issue 10 years ago • 0 comments

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.

latentflip avatar Dec 01 '14 18:12 latentflip