Skip to content

Conversation

mgol
Copy link
Member

@mgol mgol commented Feb 19, 2021

jQuery >=3.4.0 uses a special focus/blur handler pair needed to fix various
issues with checkboxes/radio buttons as well as being able to pass data in focus
triggers. This leaves extra focus & blur events if any of these events were ever
listened to at a particular element.

We've started skipping these handlers in the domEqual assertion in gh-1930 but
we missed a case where an event is triggered before any handler is attached -
jQuery >=3.4.0 attaches then an extra noop listener just to force the code path
to go through the setup code before the trigger happens. We now skip this extra
handler as well.

This fixes a test failure in "dialog: methods" destroy tests.

Ref jquery/jquery#4496
Ref gh-1930

jQuery >=3.4.0 uses a special focus/blur handler pair needed to fix various issues with checkboxes/radio buttons as well as being able to pass data in focus triggers. This leaves extra focus & blur events if any of these events were ever listened to at a particular element. We've started skipping these handlers in the `domEqual` assertion in jquerygh-1930 but we missed a case where an event is triggered before any handler is attached - jQuery >=3.4.0 attaches then an extra noop listener just to force the code path to go through the setup code before the trigger happens. We now skip this extra handler as well. This fixes a test failure in "dialog: methods" destroy tests. Ref jquery/jquery#4496 Ref jquerygh-1930
@mgol mgol requested review from arschmitz and fnagel February 19, 2021 20:29
Copy link
Member

@fnagel fnagel left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+1 by reading

@mgol mgol merged commit 5b5fda7 into jquery:main Feb 20, 2021
@mgol mgol deleted the extra-focus-listener branch February 20, 2021 18:11
@mgol mgol added this to the 1.13 milestone Feb 21, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

2 participants