Skip to content

Commit

Permalink
fix(VMenu): show menu if value isActive on mount
Browse files Browse the repository at this point in the history
fixes #6034
  • Loading branch information
johnleider committed Jan 18, 2019
1 parent a04d639 commit 094a85e
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 0 deletions.
4 changes: 4 additions & 0 deletions packages/vuetify/src/components/VMenu/VMenu.js
Expand Up @@ -166,6 +166,10 @@ export default Vue.extend({
}
},

mounted () {
this.isActive && this.activate()
},

methods: {
activate () {
// This exists primarily for v-select
Expand Down
17 changes: 17 additions & 0 deletions packages/vuetify/test/unit/components/VMenu/VMenu.spec.js
Expand Up @@ -438,4 +438,21 @@ test('VMenu.js', ({ mount, compileToFunctions }) => {
expect(menu.vm.isActive).toBe(false)
expect(document.activeElement).toBe(input[2].element)
})

it('should show the menu on mounted', () => {
const activate = jest.fn()
mount(VMenu, {
methods: { activate }
})

expect(activate).not.toBeCalled()

mount(VMenu, {
propsData: { value: true },
methods: { activate }
})
expect(activate).toBeCalled()

expect('Unable to locate target [data-app]').toHaveBeenTipped()
})
})

0 comments on commit 094a85e

Please sign in to comment.