Opened 7 years ago

Closed 7 years ago

Last modified 6 years ago

#17100 closed enhancement (fixed)

Dialog: show()/hide() should return a deferred in every condition

Reported by: gorgoroth Owned by: bill
Priority: undecided Milestone: 1.10
Component: Dijit Version: 1.8.3
Keywords: Cc:
Blocked By: Blocking:

Description

Currently Dialog::show() does not return a deferred if open class member is true. A similar problem is present in Dialog::hide() when the open class member is false. I think it is better to always return a resolved deferred in theese scenarios because a program could invoke Dialog::show().then() and if the dialog is already shown, no defferred/promise is returned and 'then' would fail.

Attachments (1)

index-dialogtest.html (2.4 KB) - added by spaquette 6 years ago.
Test for Dialog show/hide not returning a promise in all cases

Download all attachments as: .zip

Change History (6)

comment:1 Changed 7 years ago by bill

Milestone: tbd1.10
Status: newassigned

I thought I fixed that already but I guess not. OK, agreed.

comment:2 Changed 7 years ago by Bill Keese <bill@…>

Resolution: fixed
Status: assignedclosed

In 8cbe1a44b75e564bb9a0f4931bf6f26e0ac16b00/dijit:

Error: Processor CommitTicketReference failed
Unsupported version control system "git": Can't find an appropriate component, maybe the corresponding plugin was not enabled? 

Changed 6 years ago by spaquette

Attachment: index-dialogtest.html added

Test for Dialog show/hide not returning a promise in all cases

comment:3 Changed 6 years ago by spaquette

Apologies, I was on the wrong bug when I clicked attach. That's what I get for not double-checking...

comment:4 Changed 6 years ago by bill

OK... I tried your test case against the latest code. I don't see any exceptions in the console and this appears in the browser window:

Dialog is now shown for the first time.
value of Dialog.open: true
Second call to show after already shown; we should see this if show() is returning a promise.

Dialog is now hidden for the first time.
value of Dialog.open: false
Second call to hide after already hidden; we should see this if hide() is returning a promise.

Your test does fail against 1.9, which makes sense, since this ticket is marked as fixed in 1.10.

comment:5 Changed 6 years ago by bill

#17779 is a duplicate of this ticket.

Note: See TracTickets for help on using tickets.