Bug Tracker

Modify

Ticket #6319 (closed bug: fixed)

Opened 4 years ago

Last modified 2 years ago

Regression: stopPropagation inside change handlers in IE is incorrectly applied to keydown event

Reported by: mikecapp Owned by: dmethvin
Priority: high Milestone: 1.7
Component: event Version: 1.4.3
Keywords: change keydown IE Cc:
Blocking: Blocked by:

Description

On switching from 1.3.2 to 1.4.2, some of our document-level ENTER keydown handlers stopped working when triggered from a just-modified textbox.

STEPS TO REPRODUCE:

  1. Load attached reduction
  1. Click on page background, then in textbox
  1. Type something
  1. Press ENTER
  1. Press ENTER again

EXPECTED RESULTS:

The green ENTER indicator bar should flash for each press

ACYUAL RESULTS:

The green ENTER bar does NOT flash for the first press, although the red CHANGE bar does. The green bar DOES flash for the second press.

FURTHER DETAILS:

The reduction binds a handler to the change event on the input, which calls stopPropagation().

Reduction tested on Win2003/IE7; also reported on XP/IE6.

Not reproducible on non-IE browsers.

Reproducible with current nightly.

HYPOTHESIS: (a.k.a. "wild speculation")

1.3.2/IE didn't raise a change event on Enter; this could be a problem since the Enter will often be triggering form submission.

1.4.2 fixes this by detecting Enter keydowns and raising the change manually.

However, it's not cloning (or dummying up) the event object passed to the change handler, so that stopPropagation() on the change event is also stopping propagation of the keydown event.

Attachments

jq142_enter.html Download (1.4 KB) - added by mikecapp 4 years ago.
Reduction
jquery-ie-onchange.zip Download (28.1 KB) - added by jtmoree@… 4 years ago.

Change History

Changed 4 years ago by mikecapp

Reduction

Changed 4 years ago by jtmoree@…

comment:1 Changed 4 years ago by jtmoree@…

I am having almost the same issue. All other browsers work fine. IE7 does not work. In my case I have to change the text field twice for the onchange event to fire. Does not matter if it is focussed with the mouse or keyboard. I am using tab to move between fields. The enter key can be used to active the onchange in other browsers but not in IE 7.

comment:2 Changed 4 years ago by jtmoree@…

Switched from 1.4.1 to 1.4.2 and the problem still existed for a while then went away. Now I cannot recreate. was probably a caching issue. Sorry.

comment:3 Changed 4 years ago by snover

  • Priority set to undecided

comment:4 Changed 4 years ago by snover

  • Summary changed from Regression: change fixup interfering with keydown in IE to Regression: stopPropagation inside change handlers in IE is incorrectly applied to keydown event

comment:5 Changed 4 years ago by snover

  • Priority changed from undecided to high
  • Status changed from new to open
  • Version changed from 1.4.2 to 1.4.3
  • Milestone changed from 1.4.3 to 1.4.4

comment:6 Changed 4 years ago by snover

  • Milestone changed from 1.4.4 to 1.5

comment:7 Changed 3 years ago by dmethvin

  • Owner set to dmethvin
  • Status changed from open to assigned

comment:8 Changed 3 years ago by dmethvin

  • Status changed from assigned to closed
  • Resolution set to fixed

Fixed in 1.5.1.

comment:9 Changed 3 years ago by dmethvin

  • Status changed from closed to reopened
  • Resolution fixed deleted

Whoops, no it wasn't, I misinterpreted the test case.

comment:10 Changed 3 years ago by timmywil

  • Status changed from reopened to open

comment:11 Changed 3 years ago by john

  • Milestone set to 1.next

comment:12 Changed 3 years ago by dmethvin

  • Milestone changed from 1.next to 1.7

This seems to be fixed in my 1.7 branch; I'll retest once it lands in master.

comment:13 Changed 3 years ago by Dave Methvin

  • Status changed from open to closed
  • Resolution set to fixed

Rewrite IE special change/submit to make it faster/shorter. Fixes #6319.

Changeset: df6e0d508efd3aa2e242e61d810d22d3491e221c

Please follow the  bug reporting guidlines and use  jsFiddle when providing test cases and demonstrations instead of pasting the code in the ticket.

View

Add a comment

Modify Ticket

Action
as closed
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.