Skip to content

Commit

Permalink
Merge pull request #4869 from nextcloud-libraries/fix/app-navigation-…
Browse files Browse the repository at this point in the history
…-closed-on-mobile-by-default

fix(NcAppNavigation): closed on mobile initially
  • Loading branch information
ShGKme committed Nov 22, 2023
2 parents 6e2963a + 7b035c4 commit 570fa66
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 11 deletions.
14 changes: 7 additions & 7 deletions src/components/NcAppNavigation/NcAppNavigation.vue
Original file line number Diff line number Diff line change
Expand Up @@ -93,12 +93,6 @@ export default {
NcAppNavigationToggle,
},
setup() {
return {
isMobile: useIsMobile(),
}
},
props: {
/**
* The aria label to describe the navigation
Expand All @@ -117,9 +111,15 @@ export default {
},
},
setup() {
return {
isMobile: useIsMobile(),
}
},
data() {
return {
open: true,
open: !this.isMobile,
focusTrap: null,
}
},
Expand Down
9 changes: 5 additions & 4 deletions tests/unit/components/NcAppNavigation/NcAppNavigation.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,11 @@ const findNavigation = (wrapper) => wrapper.get(NAVIGATION__SELECTOR)
const findToggleButton = (wrapper) => wrapper.get(TOGGLE_BUTTON__SELECTOR)

describe('NcAppNavigation.vue', () => {
beforeEach(async () => {
// Emulate desktop size
await resizeWindowWidth(1024)
})

describe('by default', () => {
it('is open', () => {
const wrapper = mount(NcAppNavigation)
Expand Down Expand Up @@ -81,10 +86,6 @@ describe('NcAppNavigation.vue', () => {
})

describe('toggle via mobile state', () => {
beforeEach(async () => {
await resizeWindowWidth(1024)
})

it('closes on switch to mobile', async () => {
const wrapper = mount(NcAppNavigation)

Expand Down

0 comments on commit 570fa66

Please sign in to comment.