googlearchive / core-scroll-header-panel

Fancy scrolling effects where the header animates between tall and condensed states
19 stars 16 forks source link

core-scroll-header-panel incorrectly setup when invisible #23

Closed amannn closed 9 years ago

amannn commented 9 years ago

Just in case, if you don't already know about this issue:

The core-scroll-header-panel is incorrectly setup when it is initialized, while it has the CSS property display set to none.

This problem occured to me, when using core-scroll-header-panel with flatiron-director. When the core-scroll-header-panel is on a view, that isn't the first to be loaded, the header is setup incorrectly. This results into the core-toolbar covering the content area and also the "condenses" mode to not work. If the view of the core-scroll-header-panel is loaded first, everything works fine.

In the meantime: Is there a workaround to manually re-initialize the core-scroll-header-panel when the view is loaded?

Many thanks!

frankiefu commented 9 years ago

You can call measureHeaderHeight manually. https://github.com/Polymer/core-scroll-header-panel/blob/master/core-scroll-header-panel.html#L143

amannn commented 9 years ago

Thanks, that worked!

If somebody else has the same problem, the event core-animated-pages-transition-prepare is the right moment to call measureHeaderHeight.

tjsavage commented 9 years ago

Glad this is resolved! Closing here.