Skip to content
This repository has been archived by the owner on Dec 25, 2017. It is now read-only.

Commit

Permalink
try/catch Firefox dispatchEvent bug when events are fired on disabled…
Browse files Browse the repository at this point in the history
… non-attached form controls

Fixes: #132
  • Loading branch information
losadaem committed Jan 13, 2016
1 parent f3de605 commit e2bd08f
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/util.js
Original file line number Diff line number Diff line change
Expand Up @@ -104,5 +104,9 @@ export function attr (el, name) {
export function trigger (el, event) {
let e = document.createEvent('HTMLEvents')
e.initEvent(event, true, false)
el.dispatchEvent(e)
// Due to Firefox bug, events fired on disabled
// non-attached form controls can throw errors
try {
el.dispatchEvent(e)
} catch(e) {}
}

0 comments on commit e2bd08f

Please sign in to comment.