- Notifications
You must be signed in to change notification settings - Fork20.6k
Commitdbcffb3
authored
Event: Make focus re-triggering not focus the original element back
If during a focus handler another focus event is triggered:```jselem1.on( "focus", function() {elem2.trigger( "focus" );} );```due to their synchronous nature everywhere outside of IE the hack added ingh-4279 to leverage native events causes the native `.focus()` method to becalled last for the initial element, making it steal the focus back. Sincethe native method is already being called in `leverageNative`, we can skip thatfinal call.This aligns with changes to the `_default` method for the `click` event thatwere added when `leverageNative` was introduced there.A side effect of this change is that now `focusin` will only propagate to thedocument for the last focused element. This is a change in behavior but it alsoaligns us better with how this works with native methods.Fixesgh-4382Closesgh-4813Refgh-42791 parent6984d17 commitdbcffb3
2 files changed
+40
-0
lines changedLines changed: 6 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
746 | 746 |
| |
747 | 747 |
| |
748 | 748 |
| |
| 749 | + | |
| 750 | + | |
| 751 | + | |
| 752 | + | |
| 753 | + | |
| 754 | + | |
749 | 755 |
| |
750 | 756 |
| |
751 | 757 |
| |
|
Lines changed: 34 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
3291 | 3291 |
| |
3292 | 3292 |
| |
3293 | 3293 |
| |
| 3294 | + | |
| 3295 | + | |
| 3296 | + | |
| 3297 | + | |
| 3298 | + | |
| 3299 | + | |
| 3300 | + | |
| 3301 | + | |
| 3302 | + | |
| 3303 | + | |
| 3304 | + | |
| 3305 | + | |
| 3306 | + | |
| 3307 | + | |
| 3308 | + | |
| 3309 | + | |
| 3310 | + | |
| 3311 | + | |
| 3312 | + | |
| 3313 | + | |
| 3314 | + | |
| 3315 | + | |
| 3316 | + | |
| 3317 | + | |
| 3318 | + | |
| 3319 | + | |
| 3320 | + | |
| 3321 | + | |
| 3322 | + | |
| 3323 | + | |
| 3324 | + | |
| 3325 | + | |
| 3326 | + | |
| 3327 | + | |
3294 | 3328 |
| |
3295 | 3329 |
| |
3296 | 3330 |
| |
|
0 commit comments
Comments
(0)