diff options
Diffstat (limited to 'actionview/app/assets/javascripts')
-rw-r--r-- | actionview/app/assets/javascripts/rails-ujs/utils/event.coffee | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/actionview/app/assets/javascripts/rails-ujs/utils/event.coffee b/actionview/app/assets/javascripts/rails-ujs/utils/event.coffee index a2135c9851..c8fbc64b51 100644 --- a/actionview/app/assets/javascripts/rails-ujs/utils/event.coffee +++ b/actionview/app/assets/javascripts/rails-ujs/utils/event.coffee @@ -10,6 +10,11 @@ if typeof CustomEvent isnt 'function' CustomEvent = (event, params) -> evt = document.createEvent('CustomEvent') evt.initCustomEvent(event, params.bubbles, params.cancelable, params.detail) + # IE does not set `defaultPrevented` when `preventDefault()` is called on CustomEvents + # http://stackoverflow.com/questions/23349191/event-preventdefault-is-not-working-in-ie-11-for-custom-events + evt.preventDefault = -> + Object.defineProperty this, 'defaultPrevented', get: -> + true evt CustomEvent.prototype = window.Event.prototype |