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

fix(NcAppNavigation): closed on mobile initially #4869

Merged
merged 2 commits into from
Nov 22, 2023
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
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
Loading