Fix top navigation positioning when window is resized #13007
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
This pull request adjusts the positioning of the
NavBar
withinAppBar.vue
so that the tabs in the navigation move to the second line when the page shrinks and there isn't enough space. Only after that, on smaller screen sizes, is the overflow menu dropdown button displayed.This issue is most apparent in the Coach plugin when the classroom title is very long, however this change does impact other Kolibri plugins.
To prevent the overflow menu dropdown button from appearing when the navigation is at the top position, the top NavBar is hidden and the bottom NavBar is displayed if the
breakpointLimit
is less than thewindowBreakpoint
during window resizing. Alternatively, if thebreakpointLimit
is greater than thewindowBreakpoint
, the top NavBar is shown and the bottom NavBar is hidden.Based on the length of the title property, the
breakpointLimit
is either 4 or 3. For example, if the page title is longer than 20 characters, the top NavBar will be shown until thewindowBreakpoint
equals 4.A window resize event listener has also been added to
AppBarPage
to updateappBarHeight
and improve page responsiveness when the screen size and NavBar position changes, replacing the use ofwindowBreakpoint
within AppBarPage.Before:
384394615-d324f647-e98b-4ed3-9397-85248fec9568.mp4
After:
WindowResizing.mov
References
Fixes #12813
Reviewer guidance