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

Header UI fixes #2371

Merged
merged 4 commits into from
Oct 9, 2020
Merged

Header UI fixes #2371

merged 4 commits into from
Oct 9, 2020

Conversation

askvortsov1
Copy link
Member

@askvortsov1 askvortsov1 commented Oct 7, 2020

Issue 1: Missing Header on Refresh

Due to some magic in Mithril 0.1's context:retain flag, some DOM elements were cached across page reloads. Since that has been eliminated, if we refresh the page and we are scrolled down, the "affix" class which makes the header fixed (and as a result, visible) isn't applied until the first scroll. We fix this by running ScrollListener.update() immediately to set initial navbar state.

Issue 2: Header Overlap with Custom Header

Example

This was accidentially introduced in #2131. In this PR, we revert that, and instead conditionally apply the navbar-fixed-top class only when needed, so that we can take advantage of it without always having the navbar in position:fixed, as was done in the previous solution.

Conditionally apply the navbar-fixed-top class only when needed, so that we can take advantage of it without always having the navbar in position:fixed, as was done in the previous solution. That resulted in a clash with custom headers.
Due to some magic in Mithril 0.1's context:retain flag, some DOM elements were cached across page reloads. Since that has been eliminated, if we refresh the page and we are scrolled down, the "affix" class which makes the header fixed (and as a result, visible) isn't applied until the first scroll. We fix this by running ScrollListener.update() immediately to set initial navbar state.
@askvortsov1 askvortsov1 changed the title Fix App-header contents overlapping with custom header Header UI fixes Oct 7, 2020
Copy link
Member

@clarkwinkelmann clarkwinkelmann left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Having not seen a demo of the original issue I'm unsure what exactly was happening. I see this mostly reverts #2131 so I suppose the regression is fixed.

Does this still fix the originally reported issue from #2131 ?

@askvortsov1
Copy link
Member Author

It does; it still adds that navbar-fixed-top class, but does so programatically.

Copy link
Member

@dsevillamartin dsevillamartin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code makes sense. Haven't tested locally.

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

Successfully merging this pull request may close these issues.

4 participants