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

PB-1181: menu scrollable #1160

Merged
merged 1 commit into from
Dec 9, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 @@ -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 Expand Up @@ -516,7 +516,7 @@ describe('The Import Maps Tool', () => {
.should('have.class', 'fa-square-check')
cy.checkOlLayer([bgLayer, layer1Id, layer2Id, layer4Id])

cy.get('[data-cy="menu-active-layers"]').should('be.visible').click()
cy.get('[data-cy="menu-active-layers"]').should('exist').click()
cy.get('[data-cy="active-layer-name-layer4-2"]').should('be.visible')
cy.get('[data-cy="time-selector-layer4-2"]').should('not.exist')

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
Loading