Side navigation
#10878 closed bug (fixed)
Opened November 23, 2011 09:04PM UTC
Closed January 28, 2012 09:57PM UTC
Last modified March 08, 2012 03:06PM UTC
$("select").live("change", function(){ ...broken in IE8 in jQuery 1.7
Reported by: | tavelli | Owned by: | dmethvin |
---|---|---|---|
Priority: | low | Milestone: | 1.7.2 |
Component: | event | Version: | 1.7.1 |
Keywords: | Cc: | ||
Blocked by: | Blocking: |
Description
Following example works with 1.6.4, but breaks in 1.7.x
Attachments (0)
Change History (9)
Changed November 23, 2011 09:08PM UTC by comment:1
Changed November 24, 2011 08:56PM UTC by comment:2
owner: | → tavelli |
---|---|
status: | new → pending |
This seems to work for me in Firefox 8. Is there some specific browser where it failed?
Changed November 25, 2011 09:49PM UTC by comment:3
status: | pending → new |
---|
Fails in IE8. Haven't tested in IE7 or IE6 yet, will on Monday.
Changed November 26, 2011 02:39AM UTC by comment:4
component: | unfiled → event |
---|---|
milestone: | None → 1.7.2 |
owner: | tavelli → dmethvin |
priority: | undecided → low |
status: | new → assigned |
I see it now, both the problem and the IE8 in your original title. When the element is cloned it appears the property for _change_attached has been promoted to an attribute and cloned, which means the cloned elements don't receive the event handler patch they need.
Changed November 30, 2011 04:04PM UTC by comment:5
Do you know of any workaround for this? I tried calling .off() on the select element after its clone and before it is appended back to the page, but no go.
Changed November 30, 2011 04:05PM UTC by comment:6
For now the solution is to not clone the element. If you start with a new one it won't incorrectly inherit the attribute that makes it think the event is already attached.
Changed November 30, 2011 04:18PM UTC by comment:7
The level of hackiness on this is quite high, but calling $("myclonedelement").removeAttr("_change_attached"); after its cloned and before its appended back to the page seems to fix it and work across IE and chrome.
this may have more to do with adding new elements by cloning an existing element with a listener attached?