Commit c5595e5b authored by Johann-S's avatar Johann-S Committed by XhmikosR
Browse files

Add polyfill for focusin and focusout

parent aba87279
Showing with 15 additions and 1 deletion
+15 -1
......@@ -133,7 +133,7 @@ const EventHandler = {
const fn = !delegation ? bootstrapHandler(element, handler) : bootstrapDelegationHandler(handler, delegationFn)
handlers[uid] = fn
originalHandler.uidEvent = uid
element.addEventListener(typeEvent, fn, false)
element.addEventListener(typeEvent, fn, delegation)
},
one(element, event, handler) {
......@@ -193,4 +193,18 @@ const EventHandler = {
}
}
// focusin and focusout polyfill
if (typeof window.onfocusin === 'undefined') {
(() => {
function listenerFocus(event) {
EventHandler.trigger(event.target, 'focusin')
}
function listenerBlur(event) {
EventHandler.trigger(event.target, 'focusout')
}
EventHandler.on(document, 'focus', 'input', listenerFocus)
EventHandler.on(document, 'blur', 'input', listenerBlur)
})()
}
export default EventHandler
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment