Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Stop shimmingfocusin/focusout in jQuery 4.0 #4300

Closed
@mgol

Description

@mgol

Description

Firefox has added long-missing support forfocusin/focusout eventsin version 63. Other browsers we plan to support in v4 already support the events (apart from Firefox ESR 60 but we'll drop it before jQuery 4.0 is released).

Currently,we shimfocusin/focusout in all non-IE browsers both to add support in Firefox and because order of these events is not implemented according to the spec in various browsers.It used to be wild out there but for now the situation is as follows:

Edge 17+, Chrome, Firefox & Safari dispatch the events in the following order:

  1. blur
  2. focusout
  3. focus
  4. focusin

IE 11 followsthe spec order, i.e.:

  1. focusout
  2. focusin
  3. blur
  4. focus

jQuery follows the order:

  1. focusout
  2. blur
  3. focusin
  4. focus

The fact that IE follows the spec order is a result ofblur &focus events being asynchronous there. That's also why we don't shimfocusin/focusout in IE viafocus/blur as in other browsers as that'd makefocusin/focusout asynchronous as well. This was considered in#3123.

As you can notice, the jQuery order doesn't match the spec either, it just firesblur afterfocusout &focus afterfocusin, the rest is different. Since all of the modern browsers settled on a specific non-standard events order, should we just stop shimming it in jQuery 4.0 and rely on native behavior in all browsers?

Link to test case

https://jsfiddle.net/66znLhfw/2/

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions


      [8]ページ先頭

      ©2009-2025 Movatter.jp