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

[Bugfix] Sticky - sticky-container should be 0px height when children… #8553

Merged
merged 2 commits into from
Apr 12, 2016
Merged

[Bugfix] Sticky - sticky-container should be 0px height when children… #8553

merged 2 commits into from
Apr 12, 2016

Conversation

gehasia
Copy link
Contributor

@gehasia gehasia commented Apr 8, 2016

When you have a responsive menu ("drilldown medium-dropdown" for example) and you put the dropdown in sticky mode, if you resize the window to small size to get the drilldown appears, the height of the sticky container will remains as before and you'll have a blank div between your menu and content.

See a codepen here :
https://codepen.io/gehasia/pen/JXMZJB
Just resize from medium to small and you'll se the sticky container, in red, remaining in the small size, pushing the content...

The height of the sticky-container is calculated depending on his children "sticky" element height. When using the responsive menu, if we resize the window until the drilldown breakpoint, the "sticky" dropdown will stay at the same height, but will pass in display="none". The proposal patch just test if the sticky element is displayed or not, and, in the last case, set the height of the sticky-container to 0...

gehasia added 2 commits April 8, 2016 14:13
… element is not displayed. It happens with a responsive dropdown/small-drilldown and a sticky dropdown
…rrectly if sticky and anchored height are different. Waiting for the height transition on the container to finish before firing the setSize
@gehasia
Copy link
Contributor Author

gehasia commented Apr 8, 2016

I added another commit to bugfix for a different behavior :
With a sticky top-bar with different height depending on the .is-anchored or .is-sticky class and a css transition effect, there is a visual bug. The .sticky container does not resize when switching from anchored to sticky.
The patch force the _setSizes() after passing into sticky mode. It does it after waiting for all transition effects to be finished on the data-sticky element because if setSize() is fired before waiting for this, the setSize will get the wrong newContainerSize (the one before transition...).
I updated the code pen :
https://codepen.io/gehasia/pen/JXMZJB
Just see the red flashing when scrooling up and down..

@kball
Copy link
Contributor

kball commented Apr 12, 2016

Looks good

@kball kball merged commit e786a95 into foundation:develop Apr 12, 2016
@colin-marshall
Copy link
Contributor

This messes up the sticky navigation example on the Sticky docs page. See #8645.

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.

3 participants