Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
J
jquery
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
夏彬
jquery
Commits
06e56acb
Commit
06e56acb
authored
Sep 10, 2011
by
Dave Methvin
Committed by
timmywil
Sep 19, 2011
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Narrow the invisible-element embargo to focus/blur events.
parent
4030de95
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
5 deletions
+6
-5
event.js
src/event.js
+6
-5
No files found.
src/event.js
View file @
06e56acb
...
...
@@ -35,8 +35,9 @@ var rnamespaces = /\.(.*)$/,
},
useNativeMethod
=
function
(
event
)
{
// IE throws error on focus/blur of a hidden element (#1486)
if
(
!
event
.
isDefaultPrevented
()
&&
this
[
event
.
type
]
&&
event
.
target
&&
event
.
target
.
offsetWidth
!==
0
)
{
this
[
event
.
type
]();
var
type
=
event
.
type
;
if
(
!
event
.
isDefaultPrevented
()
&&
this
[
type
]
&&
((
type
!==
"focus"
&&
type
!==
"blur"
)
||
event
.
target
.
offsetWidth
!==
0
)
)
{
this
[
type
]();
return
false
;
}
};
...
...
@@ -385,10 +386,10 @@ jQuery.event = {
!
(
type
===
"click"
&&
jQuery
.
nodeName
(
elem
,
"a"
))
&&
jQuery
.
acceptData
(
elem
)
)
{
// Call a native DOM method on the target with the same name name as the event.
// Can't use an .isFunction
)
() check here because IE6/7 fails that test.
// Can't use an .isFunction() check here because IE6/7 fails that test.
// Don't do default actions on window, that's where global variables be (#6170)
// IE<9 dies on focus to hidden element (#1486)
if
(
ontype
&&
elem
[
type
]
&&
elem
.
offsetWidth
!==
0
&&
!
jQuery
.
isWindow
(
elem
)
)
{
// IE<9 dies on focus
/blur
to hidden element (#1486)
if
(
ontype
&&
elem
[
type
]
&&
((
type
!==
"focus"
&&
type
!==
"blur"
)
||
event
.
target
.
offsetWidth
!==
0
)
&&
!
jQuery
.
isWindow
(
elem
)
)
{
// Don't re-trigger an onFOO event when we call its FOO() method
old
=
elem
[
ontype
];
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment