Opened 10 years ago
Closed 10 years ago
#12686 closed bug (wontfix)
Live change event is not fired on IE8 when input is focused
Reported by: | Owned by: | elgreg | |
---|---|---|---|
Priority: | high | Milestone: | None |
Component: | event | Version: | 1.8.2 |
Keywords: | ie7 ie8 | Cc: | |
Blocked by: | Blocking: |
Description
When 'change' event is bound whith jQuery.live() on a text input that has focus (carret blinking inside, focus() explicitly called), the 'change' event isn't fired on first value change.
I just added an explicit focus an an example from bug #5851 to show this one.
Expected behaviour (FF/Chrome OK) : when DOM is ready, the text input has focus. If you start typing text then leaving it whith tab or clicking outside, the alert shows.
IE8 (KO) behaviour : when DOM is ready, the text input has focus BUT if you start typing text then leaving it, no alert is visible. To get the alert, you have to get back into the text field then modify its value, then leaving it again.
Reported against jQuery 1.7.2 and 1.8.2.
Change History (7)
comment:1 Changed 10 years ago by
comment:2 Changed 10 years ago by
Keywords: | ie7 ie8 added |
---|---|
Status: | new → open |
Confirmed in IE8: http://jsfiddle.net/VUY3g/
Works in bare DOM: http://jsfiddle.net/VUY3g/1/
Or bare DOM with jQuery loaded: http://jsfiddle.net/VUY3g/2/
Or with attachEvent
instead of DOM0 handler: http://jsfiddle.net/VUY3g/3/
comment:3 follow-up: 4 Changed 10 years ago by
Clarifying ... the event is firing, but for these cases we need to manually bubble and we're not for some reason.
comment:4 Changed 10 years ago by
Replying to dmethvin:
Clarifying ... the event is firing, but for these cases we need to manually bubble and we're not for some reason.
Yes, I forgot to mention it works with bind() and on() without delegate. The handler is not called only if bound with live() or on() with delegate, and only for the very first change.
comment:5 Changed 10 years ago by
Component: | unfiled → event |
---|---|
Priority: | undecided → high |
comment:6 Changed 10 years ago by
Owner: | set to elgreg |
---|---|
Status: | open → assigned |
comment:7 Changed 10 years ago by
Resolution: | → wontfix |
---|---|
Status: | assigned → closed |
Took a look at this with @dmethvin. The internals of jquery spoofing event bubbling for change events in old IE mean you need to focus after attaching the live event. Simply moving the focus to after the event is attached should fix the issue:
jsfiddle: http://jsfiddle.net/elgreg/6jrU3/
Marking as won't fix as generally a delegated event can generally be attached prior to focus.
Don't know how to attache the example, here is the code :