framework7io / framework7

Full featured HTML framework for building iOS & Android apps
http://framework7.io
MIT License
18.15k stars 3.23k forks source link

Problem with navbar hideOnPageScroll and subnavbar/list-groups #4253

Open cyberbeat opened 8 months ago

cyberbeat commented 8 months ago

When using the hideOnPageScroll Feature in combination with a subnavbar and/or list-groups, it does not work as expected:

What I expect when navbar is hidden on page scroll:

This is an example (see "store" subpage with items loaded): https://codesandbox.io/p/devbox/sweet-lamarr-hvq5m7?workspaceId=36dfb8d7-565d-4fd8-9919-e9f1d23fdc4c

This is my css workaround, perhaps it would be better to add a page-level css-class for hidden navbar?

.page:has(> .navbar-hidden)  .list-group-title {
    top: calc(-1 * (var(--f7-navbar-height) + var(--f7-subnavbar-height)));
}

.navbar-hidden {
    transform: translate3d(0, calc(-1 * (var(--f7-navbar-height) + var(--f7-subnavbar-height))), 0);
}
.navbar-hidden ~ .subnavbar {
    transform: translate3d(0, calc(-1 * (var(--f7-navbar-height) + var(--f7-subnavbar-height))), 0);
}