Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Fix focus/blur delegation in Firefox and Android

This was broken in a62a32b that tried
to fix the same in IE.
  • Loading branch information...
commit 0bf68f89edd0ce0eeda719d9c19ebf0caf8f6577 1 parent e263cde
@mislav mislav authored
Showing with 3 additions and 1 deletion.
  1. +3 −1 src/event.js
View
4 src/event.js
@@ -9,6 +9,7 @@
isString = function(obj){ return typeof obj == 'string' },
handlers = {},
specialEvents={},
+ focusinSupported = 'onfocusin' in window,
focus = { focus: 'focusin', blur: 'focusout' },
hover = { mouseenter: 'mouseover', mouseleave: 'mouseout' }
@@ -38,11 +39,12 @@
function eventCapture(handler, captureSetting) {
return handler.del &&
+ (!focusinSupported && (handler.e in focus)) ||
!!captureSetting
}
function realEvent(type) {
- return hover[type] || focus[type] || type
+ return hover[type] || (focusinSupported && focus[type]) || type
}
function add(element, events, fn, data, selector, delegator, capture){
Please sign in to comment.
Something went wrong with that request. Please try again.