Opened 13 years ago

Closed 6 years ago

#8519 closed defect (fixed)

layout widget addChild()/removeChild() try to do layout even when hidden

Reported by: bill Owned by:
Priority: high Milestone: 1.11
Component: Dijit Version: 1.2.3
Keywords: Cc:
Blocked By: Blocking:

Description (last modified by bill)

Originally part of #8269 but breaking out to separate bug...

If a user calls addChild() or removeChild() on a layout widget that's been started, but is hidden, then the layout widget will try to do layout even though it's display:none, and this will result in errors. For example:

  1. page has TabContainer where one of the children is a BorderContainer?
  2. user selects the BorderContainer tab of the TabContainer? (now the BorderContainer is both started and sized)
  3. user selects another tab (now the BorderContainer is display:none)
  4. programatically, something calls BorderContainer.addChild()

Probably, if the layout widget is hidden when addChild()/removeChild() is called then it should just set a flag to re-layout itself when it becomes visible (at which point the parent widget will call resize()).

Change History (2)

comment:1 Changed 13 years ago by bill

Description: modified (diff)

Maybe widgets should have show()/hide() methods or onShow()/onHide() callbacks, plus some way to tell if they are hidden.

This also relates to #5528.

comment:2 Changed 6 years ago by bill

Milestone: future1.11
Resolution: fixed
Status: newclosed

I suppose this is no longer an issue due to 534157f1ce7473697bd3587d7b39248f50d0ac9e.

Note: See TracTickets for help on using tickets.