-
Notifications
You must be signed in to change notification settings - Fork 43
Menu selected event is fired twice #480
Comments
The issue is caused by the List component, see c24f7c8. It used to have these lines in if (this.$parent.$options._componentTag !== 'm-menu') {
this.mdcList = MDCList.attachTo(this.$el) This line was deleted, so now you have to set the onAction (e) {
this.$emit('change', this.mdcList.selectedIndex) since |
@ErikMinekus Thanks for finding the issue! Feel free to submit a PR 👍 |
@ErikMinekus So sorry that I made a mistake in previous versions. JavaScript component is optional in some components like List in mdc-web. That's why |
@tychenjiajun I'm relatively new to Vue and Material components, but I think for Menu it would be best to just hardcode I'm not familiar with how Drawer and TabBar can instantiate child components, so I can't comment on that. But it should be documented when you have to set |
@ErikMinekus In the enhanced Select, List is hardcoded to make Whatever, thank you for this issue and PR! |
* fix(menu): use provide/inject in instantiation fixes #480 * fix(menu): update demo
Describe the bug
When clicking a menu item, the
selected
event is fired twice. This started happening after updating from version 1.1.0 to 1.2.0.To Reproduce
Expected behavior
The selected event should only be fired once, as it does when using the MDC Menu component (v3.2.0) directly. See https://codepen.io/ErikMinekus/pen/wvvYPmK.
Desktop
The text was updated successfully, but these errors were encountered: