Opened 4 years ago

Closed 4 years ago

Last modified 4 years ago

#18797 closed defect (fixed)

StackContainer should allow close if onClose is not defined

Reported by: Kenneth G. Franqueiro Owned by: bill
Priority: undecided Milestone: 1.11
Component: Dijit Version: 1.9.0
Keywords: Cc:
Blocked By: Blocking:

Description

A change was made for #16267 which adds a guard to StackContainer? so that widgets without onClose don't cause explosions. However, the way it was added, a widget without onClose will never allow its tab to be closed, which doesn't seem particularly useful.

var remove = !page.onClose || page.onClose(this, page); would probably be a better guard.

It's arguable that this "breaks backcompat", but 1. there is no widget within Dijit that doesn't have onClose (since all still extend _Widget and that has a stub returning true), and 2. I can't imagine anyone finding the current behavior useful (other than that it prevents explosions when no onClose is present, which would still be true with the change).

Change History (8)

comment:1 Changed 4 years ago by bill

Agreed, that's better.

comment:2 Changed 4 years ago by Kenneth G. Franqueiro

Summary: Improve StackContainer should allow close if onClose is not definedStackContainer should allow close if onClose is not defined

comment:3 Changed 4 years ago by dylan

Milestone: tbd1.11

comment:4 Changed 4 years ago by Kenneth G. Franqueiro <kenneth.franqueiro@…>

Resolution: fixed
Status: newclosed

In ddf5304/dijit:

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

comment:5 Changed 4 years ago by Kenneth G. Franqueiro

Anyone have any opinions for/against backporting to 1.10 and 1.9? It does change an edge case, though it's admittedly an obscure one and I'm not sure the previous behavior is what people would generally expect.

comment:6 Changed 4 years ago by dylan

I think backporting it would be fine, as it's fixing an issue.

comment:7 Changed 4 years ago by wkeese <bill@…>

In 9fbda68/dijit:

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

comment:8 Changed 4 years ago by bill

I'm OK w/the backport but be sure to backport the test fix I just pushed too.

Note: See TracTickets for help on using tickets.