You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Click on the button (calls show() on the closed iron-collapse nested under a closed top-level iron-collapse).
Click on the top-level iron-collapse.
Expected outcome
The top-level iron-collapse opens and reveals an open nested iron-collapse.
Actual outcome
The top-level iron-collapse opens and reveals an apparently closed nested iron-collapse. (In fact its opened is true but its height is 0.
Clicking on the nested iron-collapse seemingly does nothing (in fact it sets opened to false).
Clicking it again reveals it as expected.
This is due to the way the animation code tries to calculate the target height by setting the desired style and calling getBoundingClientRect. Unfortunately when the element is nested under a hidden parent menu (display: none), gBCR returns 0 as height.
* Skip animation if not in render tree (else causes broken state)
* Added test for nested components
* Remove nested open test, add test checking visible size
* Add test for nested horizontal collapse
* Rename to isDisplayed and document
Description
Programmatically expanding (
show()
) a hidden submenu puts it in a buggy state, whereopened
istrue
but the CSSheight
is0px
.This is due to a bug in the animation code, and therefore only manifests if the submenu has animations turned on (which is the default).
Live Demo
http://jsbin.com/rutakeciri/edit?html,output
Steps to reproduce
show()
on the closediron-collapse
nested under a closed top-leveliron-collapse
).iron-collapse
.Expected outcome
The top-level
iron-collapse
opens and reveals an open nestediron-collapse
.Actual outcome
The top-level
iron-collapse
opens and reveals an apparently closed nestediron-collapse
. (In fact itsopened
istrue
but itsheight
is0
.Clicking on the nested
iron-collapse
seemingly does nothing (in fact it setsopened
tofalse
).Clicking it again reveals it as expected.
This is due to the way the animation code tries to calculate the target height by setting the desired style and calling
getBoundingClientRect
. Unfortunately when the element is nested under a hidden parent menu (display: none
), gBCR returns 0 as height.Browsers Affected
See #49 for a fix.
Note that I've encountered this issue when using
paper-menu
(which usesiron-collapse
internally).The text was updated successfully, but these errors were encountered: