Skip to content

Commit

Permalink
PB-1181: menu scrollable
Browse files Browse the repository at this point in the history
  • Loading branch information
sommerfe committed Dec 4, 2024
1 parent 7356671 commit c2fc5e2
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 6 deletions.
8 changes: 8 additions & 0 deletions src/modules/menu/MenuModule.vue
Original file line number Diff line number Diff line change
Expand Up @@ -177,6 +177,14 @@ $openCloseButtonHeight: 2.5rem;
}
}
}
@include respond-below(phone) {
.menu {
.menu-tray {
overflow: auto;
}
}
}
// transition definitions
.fade-in-out-enter-active,
.fade-in-out-leave-active {
Expand Down
6 changes: 6 additions & 0 deletions src/modules/menu/components/menu/MenuTray.vue
Original file line number Diff line number Diff line change
Expand Up @@ -188,6 +188,12 @@ function addRefBySectionId(el) {
font-size: 0.825rem;
}
@include respond-below(phone) {
.menu-tray-inner {
overflow: unset;
}
}
@include respond-above(lg) {
.help-section {
// See HeaderWithSearch.vue css where the help-section is enable below lg
Expand Down
4 changes: 2 additions & 2 deletions tests/cypress/tests-e2e/importToolMaps.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ describe('The Import Maps Tool', () => {
cy.goToMapView({}, true)
cy.openMenuIfMobile()
})
it('Import external wms layers', () => {
it.only('Import external wms layers', () => {
cy.intercept(
{
https: true,
Expand Down Expand Up @@ -277,7 +277,7 @@ describe('The Import Maps Tool', () => {
//-----------------------------------------------------------------------------------------
cy.log('Toggle import menu')
cy.get('[data-cy="menu-advanced-tools-import_maps"]').should('have.class', 'text-primary')
cy.get('[data-cy="menu-advanced-tools-import_maps"]').should('be.visible').click()
cy.get('[data-cy="menu-advanced-tools-import_maps"]').should('exist').click()
cy.get('[data-cy="menu-advanced-tools-import_maps"]').should(
'not.have.class',
'text-primary'
Expand Down
13 changes: 9 additions & 4 deletions tests/cypress/tests-e2e/menuTray.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ function checkOpenSections(openSections) {
sections
.filter((section) => openSections.includes(section.name))
.forEach((section) => {
cy.get(section.selector).should('be.visible')
cy.get(section.selector).should('exist')
})
sections
.filter((section) => !openSections.includes(section.name))
Expand Down Expand Up @@ -217,7 +217,7 @@ describe('Test menu tray ui', () => {
init(30, 30)
checkOpenSections(['topics', 'activeLayers'])
measureMenu(true)
checkScrollbarVisibility(true, true)
checkScrollbarVisibility(false, false)

cy.get(menuActiveLayersHeaderSelector).click()
waitForAnimationsToFinish()
Expand Down Expand Up @@ -249,11 +249,16 @@ describe('Test menu tray ui', () => {
checkOpenSections(['topics'])
measureMenu(true)
})
it('Each open menu section has a minimal height, even if there is a high discrepancy between their original heights', () => {
it('Each open menu section is entirely unfolded and you can scroll the entire menu', () => {
init(30, 2)
checkOpenSections(['topics', 'activeLayers'])
measureMenu(true)
checkScrollbarVisibility(true, false)
checkScrollbarVisibility(false, false)

cy.get('[data-cy="menu-tray"]').then(($body) => {
cy.wrap($body).invoke('outerHeight').should('eq', 498)
cy.wrap($body).invoke('prop', 'scrollHeight').should('eq', 1571)
})
})
it('no scrolling if menus are small enough', () => {
init(3, 2)
Expand Down

0 comments on commit c2fc5e2

Please sign in to comment.