Skip to content

app.toolbar.hide() doesn't update --f7-page-toolbar-bottom-offset #4337

@huajiqaq

Description

@huajiqaq
  • Framework7 version: 8.3.4
  • Platform and Target: Windows
  • Live Link or CodeSandbox: None

Describe the bug

When using the app.toolbar.hide() method to dynamically hide a fixed bottom Tabbar with the tabbar-icons class (e.g., called during route navigation), the .page-content element retains its padding-bottom controlled by the CSS custom property --f7-page-toolbar-bottom-offset. Even after the Tabbar is hidden, this padding-bottom does not automatically update to 0, causing an unwanted blank area at the bottom of the page content.

To Reproduce

  1. Create a new project using the Framework7 CLI (e.g., Tab View template).
  2. Ensure the Tabbar includes the tabbar-icons class.
  3. After navigating to a route (e.g., in a route's pageAfterIn hook), call app.toolbar.hide('.toolbar.toolbar-bottom') to hide the Tabbar.
  4. Observe the page loaded after the route navigation.
  5. Check the .page-content element of the page; its padding-bottom is still determined by --f7-page-toolbar-bottom-offset (a non-zero value).

Expected behavior

When app.toolbar.hide() is called and successfully hides the Tabbar with tabbar-icons, Framework7 should automatically update the --f7-page-toolbar-bottom-offset CSS variable to 0px, thereby causing the padding-bottom of .page-content to also become 0px, eliminating the bottom space. Conversely, when app.toolbar.show() is called, --f7-page-toolbar-bottom-offset should revert to the Tabbar's height.

Actual Behavior

The app.toolbar.hide() and app.toolbar.show() methods only handle toggling the Tabbar element's visibility via CSS classes (like toolbar-hidden) and trigger toolbar:hide / toolbar:show DOM events and toolbarHide / toolbarShow application events. They fail to automatically update the layout-related CSS variable --f7-page-toolbar-bottom-offset for .page-content. Consequently, the padding-bottom of .page-content remains unchanged, becoming inconsistent with the Tabbar's actual visibility state.

Screenshots

Additional context

  • Known workaround: Manually set the padding-bottom of the .page-content element to 0 after hiding the Tabbar (e.g., within the route's pageAfterIn hook or by listening to the toolbar:hide event).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions