#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)
Change History (6)
comment:1 Changed 9 years ago by
Milestone: | tbd → 1.10 |
---|---|
Status: | new → assigned |
comment:2 Changed 9 years ago by
Resolution: | → fixed |
---|---|
Status: | assigned → closed |
Changed 8 years ago by
Attachment: | index-dialogtest.html added |
---|
Test for Dialog show/hide not returning a promise in all cases
comment:3 Changed 8 years ago by
Apologies, I was on the wrong bug when I clicked attach. That's what I get for not double-checking...
comment:4 Changed 8 years ago by
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.
I thought I fixed that already but I guess not. OK, agreed.