Opened 9 years ago

Closed 9 years ago

#11346 closed defect (fixed)

Dialog: cancel button executes dialog instead of canceling it

Reported by: Scott Moore Owned by: bill
Priority: high Milestone: 1.5
Component: Dijit Version: 1.4.3
Keywords: dijit Dialog Action Buttons Cancel Cc:
Blocked By: Blocking:

Description (last modified by bill)

I am looking at the test

http://archive.dojotoolkit.org/nightly/dojotoolkit/dijit/tests/test_Dialog.html

When I click on the "Show Dialog with Action Buttons" and I hit the Cancel button, it appears to fire the Ok button event. I am not sure if the test is bad or if there is a bug in the Dialog itself.

Attachments (1)

cancelButton.patch (4.2 KB) - added by bill 9 years ago.
patch for type=cancel support on Buttons, except that parser on IE8 can't handle it

Download all attachments as: .zip

Change History (5)

comment:1 Changed 9 years ago by James Burke

Component: GeneralDijit
Owner: anonymous deleted

comment:2 Changed 9 years ago by bill

Description: modified (diff)
Milestone: tbd1.5
Owner: set to bill
Status: newassigned
Summary: dijit.Dialog with Action Buttons always fires Execute but not cancelDialog: cancel button executes dialog instead of canceling it

Hmm, you are right, I think it's both a problem with the test and a problem with the code. The test has type=submit for the Cancel button. I guess it should be type=cancel, although there's no such type as part of the HTML spec. That's how I documented it in the release notes.

More like a missing feature, technically.

comment:3 Changed 9 years ago by bill

Turns out that type=cancel won't fly on IE8, at least for <button> tags. It shows up as type=submit. So I'll just update the test case and documentation to use a <button type=button> with an onClick handler to close the dialog.

Changed 9 years ago by bill

Attachment: cancelButton.patch added

patch for type=cancel support on Buttons, except that parser on IE8 can't handle it

comment:4 Changed 9 years ago by bill

Resolution: fixed
Status: assignedclosed

(In [22386]) Change examples for Dialog Cancel button, since <button dojoType=dijit.form.Button type=cancel> isn't supported by dijit, and it can't be supported in IE8, short of #10153. Refs #10153, fixes #11346.

Note: See TracTickets for help on using tickets.