Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

App-header display none #280

Open
1 of 8 tasks
JessedeRuijter opened this issue Jul 22, 2016 · 4 comments
Open
1 of 8 tasks

App-header display none #280

JessedeRuijter opened this issue Jul 22, 2016 · 4 comments

Comments

@JessedeRuijter
Copy link

Description

If the app-header is initialized while having display: "none", it won't work properly when it's display is set later. This also means that having two app-headers on different pages in an iron-pages or neon-animated-pages will result in one of the two not working properly (the one which was on the hidden page while opening the app).

Expected outcome

The toolbar resizes, scroll-effects like waterfall etc. show as usual.

Actual outcome

No animations are shown, the toolbar doesn't resize as intended.

Live Demo

Will add later.

Steps to reproduce

  1. Create a page with an app-header which is initially hidden.
  2. After the page has finished loading, show the app-header.
    3.It won't work properly.

Browsers Affected

  • Chrome
  • Firefox
  • Safari 9
  • Safari 8
  • Safari 7
  • Edge
  • IE 11
  • IE 10
@blasten
Copy link
Contributor

blasten commented Aug 1, 2016

If the header isn't render, you can notify visibility change by implementing iron-resizable-behavior or calling resetLayout on the app-header manually. iron-pages implements that behavior, so it should just work (http://jsbin.com/beguna/edit?html,output) neon-animated-pages also implements that behavior, but the resize event fires at the end of the animation which I agree it isn't desirable.

@tktr
Copy link

tktr commented Jan 25, 2017

Calling resetLayout on the app-header after changing the display property seems to work only when switching e.g. to display: "inline" but the height of the header remains occupied when setting display: "none" again.

Demo

https://jsbin.com/fodiqabosi/edit?html,output

@keanulee
Copy link
Contributor

@tktr You'll need to call resetLayout on <app-header-layout>, since that's what is positioning and adding the margin to the content after the header.

@rwestlund
Copy link

This just bit me as well. Needing to call resetLayout() manually was not expected behavior. At the very least, there should be a note about this in the documentation.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

6 participants