Dani
Dani

Reputation: 5908

IE8 issue with triggering change event

I currently have a class where a default on change event is added to checkboxes.

the default change event works in most of cases but in some cases i remove the change event and i add a custom change event.

However, only in IE8, it seems if i set:

ele.checkbox.checkek = true;

then the change event that i have set on the checkbox is triggered. In all other browsers i have to call fireEvent('change') in order to trigger to change event.

Is it possible to prevent that from happening or if there is a way i can determine when there are custom change events added?

Thanks.

Upvotes: 4

Views: 415

Answers (1)

Dimitar Christoff
Dimitar Christoff

Reputation: 26165

this is because of a bubbling onpropertychange, which mootools tries to normalise for you and convert to a change event... see this commit from 19 days ago: https://github.com/mootools/mootools-core/commit/8c97db6ba4b8a7f3b900f355d972c66b36a636b4 - may have been broken by commits from Daniel Buchner and partly myself, i reckon.

you should be able to just do element.fireEvent('change') to call your callback anyway

Upvotes: 2

Related Questions