Skip to content

Loading…

ticket 7071 - Accessing the 'type' property on VML elements fails on IE #434

Merged
merged 1 commit into from

4 participants

@Bubbi

Make sure that Internet Explorer 6-8 won't give a "failed" error, when a request for type is made on vml objects.

Testcase for the bug can be found here: http://jsfiddle.net/7p3Yr/23/

@rwaldron
jQuery Foundation member

Please provide a test/unit/event.js test

@robertvogel

Hey -

I think I have a simple reduced case that should help - here it is:

http://www.peakdemocracy.com/p/demo/error/statements1.html

Click on the polygon (triangle) and you'll see the error in IE7/8. The error disappears when you remove jquery-ujs, or when you remove

disableDefaultUI: true,

in the options for the googlemap.

@dmethvin
jQuery Foundation member

This change made it into the IE change special handler but for some reason wasn't applied to the submit one as well.

@dmethvin dmethvin merged commit 84936f1 into jquery:master
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Jul 15, 2011
  1. @Bubbi

    Make sure that Internet Explorer 6-8 won't give a "failed" error, whe…

    Bubbi committed
    …n a request for type is made on vml objects
Showing with 4 additions and 3 deletions.
  1. +4 −3 src/event.js
View
7 src/event.js
@@ -703,7 +703,7 @@ if ( !jQuery.support.submitBubbles ) {
if ( !jQuery.nodeName( this, "form" ) ) {
jQuery.event.add(this, "click.specialSubmit", function( e ) {
var elem = e.target,
- type = elem.type;
+ type = jQuery.nodeName( elem, "input" ) ? elem.type : "";
if ( (type === "submit" || type === "image") && jQuery( elem ).closest("form").length ) {
trigger( "submit", this, arguments );
@@ -712,7 +712,7 @@ if ( !jQuery.support.submitBubbles ) {
jQuery.event.add(this, "keypress.specialSubmit", function( e ) {
var elem = e.target,
- type = elem.type;
+ type = jQuery.nodeName( elem, "input" ) ? elem.type : "";
if ( (type === "text" || type === "password") && jQuery( elem ).closest("form").length && e.keyCode === 13 ) {
trigger( "submit", this, arguments );
@@ -737,7 +737,8 @@ if ( !jQuery.support.changeBubbles ) {
var changeFilters,
getVal = function( elem ) {
- var type = elem.type, val = elem.value;
+ var type = jQuery.nodeName( elem, "input" ) ? elem.type : "",
+ val = elem.value;
if ( type === "radio" || type === "checkbox" ) {
val = elem.checked;
Something went wrong with that request. Please try again.