Skip to content

Dialog: Add type="button" to the close button. Fixed #9312: Dialog: clos... #995

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from

Conversation

tjvantoll
Copy link
Member

...es on enter in textbox in IE.

I cannot come up with a way to simulate this behavior in IE in a unit test. This is the test that I tried writing:

test( "#9312: dialog closes on enter keypresses in textboxes", function() {
    expect( 1 );
    var input = $( "<input>" ),
        dialog = $( "<div></div>" )
            .html( input )
            .dialog();

    input.simulate( "keydown", { keyCode: $.ui.keyCode.ENTER });

    ok( dialog.dialog( "isOpen" ) );
    dialog.dialog( "destroy" );
});

Except this doesn't force the close button's click event to fire. If I'm missing something obvious let me know. I went with an explicit inline comment for now.

@@ -342,7 +342,9 @@ $.widget( "ui.dialog", {
}
});

this.uiDialogTitlebarClose = $("<button></button>")
Copy link
Member

Choose a reason for hiding this comment

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

Add a line:

// support: IE

@scottgonzalez
Copy link
Member

Looks good. Landing this without a test seems fine. Just add the support comment and land it :-)

@tjvantoll
Copy link
Member Author

Landed in c19e7b3.

@tjvantoll tjvantoll closed this May 23, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants