Wednesday, March 2, 2016

Aurelia change event Firefox woes

In the continuing adventures of Firefox vs other browsers (see Aurelia Firefox and Input fields), I was watching a checkbox using a change.trigger() to update the checkbox selection state for a search facet.  I noticed in Firefox that the change event checkbox selection value was pre-change vs Chrome and other browsers where the selection value was post-change.

Gitter Aurelia conversation discussed the issue and approach to fix it.

Using change.delegate gives the change event time to finish processing before it's handled.  I'm a little concerned about timing issues still as this doesn't seem deterministic, but it's working pretty well now.

1 comment:

  1. Hi William. Thanks for your insights and your tutorials on custom events. I am using the code you wrote to help me with a problem I am facing.

    I have the problem you described, that is change.delegate firing before the value is changed on FF and after the change on Chrome. This is happening in a custom element.

    Do you suggest using the DOM level custom events or is there an Aurelia only solution that does not require jQuery of DOM medling of any sort?

    Do you think using change.trigger is an option?

    ReplyDelete