Opened 10 years ago

Closed 6 years ago

Last modified 6 years ago

#8345 closed feature (fixed)

Dialog: add an option so that it can't be closed by "normal means"

Reported by: liucougar Owned by: liucougar
Priority: low Milestone: 1.9
Component: Dijit Version: 1.2.3
Keywords: Cc:
Blocked By: Blocking:

Description

introduce closable option on dijit.Dialog, which is by default true.

If it is set to false, the close button on the titlebar will be hidden, and escape key won't close this dialog.

onExecute/onCancel won't hide the dialog automatically if closable=false

developer has to make sure that, if closable=false is used, some controls (such as buttons) are available in the content of the dialog, so that the end user can close it if some criteria is met

Change History (8)

comment:1 Changed 10 years ago by dante

fwiw, this is already possible with dojox.widget.Dialog modal=true

it simply intercepts a connect to dijit._underlay in show() and listens for esc calling dojo.stopEvent(e) when found.

comment:2 Changed 10 years ago by bill

Summary: add an option to dialog so that it can't be closed by "normal means"Dialog: add an option so that it can't be closed by "normal means"

Almost, except that (as Cougar pointed out to me) the [x] icon still shows up.

BTW, the term modal for that parameter is incorrect, as all Dialogs are modal. Maybe "closable" is a better name, although that too is confusing given that the user can still presumably close the dialog somehow, by clicking on a button in the dialog.

comment:3 Changed 10 years ago by dante

@bill - I agree the term 'modal' is slightly confusing. Honestly, I thought dojox.Dialog already had a closable param that disabled the X showing up onmouseenter. One line fix to change that. But I still would like to see this behavior in dijit.Dialog officially.

comment:4 Changed 10 years ago by bill

Milestone: 1.3future

comment:5 Changed 6 years ago by bill

Priority: highlow

FYI, this is achievable via CSS:

#myDialog .closeButtonNode {
   display: none;
}

Oh, except that doesn't handle using ESC to close the Dialog.

See also #9670, which asks for a similar feature and discusses disabling the ESC key.

Last edited 6 years ago by bill (previous) (diff)

comment:6 Changed 6 years ago by bill

#9670 is a duplicate of this ticket.

comment:7 Changed 6 years ago by bill

Resolution: fixed
Status: newclosed

In [30966]:

Add Dialog.closable property, to hide the [x] icon and disable ESC as a way to close the dialog. Also removing aria-describedby property, as this is handled implicitly by _WidgetBase. Fixes #8345 !strict.

comment:8 Changed 6 years ago by bill

Milestone: future1.9
Type: enhancementfeature
Note: See TracTickets for help on using tickets.