Comments (5)
The issue is caused by the List component, see c24f7c8. It used to have these lines in mounted()
:
if (this.$parent.$options._componentTag !== 'm-menu') {
this.mdcList = MDCList.attachTo(this.$el)
This line was deleted, so now you have to set the js
prop to false
to ensure it doesn't instantiate the MDCList component. Except this causes a JavaScript error here:
onAction (e) {
this.$emit('change', this.mdcList.selectedIndex)
since this.mdcList
is not instantiated.
from material-components-vue.
@ErikMinekus Thanks for finding the issue! Feel free to submit a PR
from material-components-vue.
@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 js
is introduced. And some components like Menu, Drawer and Tab Bar can instantiate their children component, which may cause duplicate instantiation. I've fixed this issue in Tab Bar in #443 and discuss some solutions in #113. But there's still lots of work to do on the other components including Menus. Excuse for any mistakes in my explanations and feel free to help or submit a PR.
from material-components-vue.
@tychenjiajun I'm relatively new to Vue and Material components, but I think for Menu it would be best to just hardcode <ul class="mdc-list">
in the Menu component, like in the enhanced Select. This would be a breaking change, but at least people can't forget to set js
to false
.
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 js
to false
.
from material-components-vue.
@ErikMinekus In the enhanced Select, List is hardcoded to make enhanced
reactive. So I think it's better to keep it hardcoded in mdc-web version 3.x.x
. Since 4.0.0
, the basic Select is deprecated and only enhanced Select is kept. So our enhanced
will be deprecated too. I thinks it's ok to introduce more breaking change when updating to mdc-web 4.0.0
so Select will be changed to the same style as what Menu is now.
Whatever, thank you for this issue and PR!
from material-components-vue.
Related Issues (20)
- [Select] Not handling model value HOT 1
- List items without ripple HOT 1
- [Select] Add to README property βenhancedβ and provide Enhanced Select example
- [TopAppBar] Icons classes aren't applied correctly
- [Tab] Tabs animation change after changing `spanningOnlyContent` multiple times
- Implement Data Tables
- Impossible to create a full-width text area with a label HOT 2
- Failed to load HOT 5
- Invalid prop: type check failed when using m-text-field and numbers HOT 4
- Many CSS-Classes not applied - even though no import errors
- Allow using different icon styles
- Nuxt support HOT 2
- [Top App Bar] Nav button loose ripple and event listener after DOM change.
- Add a base wrapper component <m-component>
- v-ripple on router-link: mdc classes get lost HOT 2
- `Unbounded` modifier for Ripple HOT 4
- Import every component without importing them individually HOT 3
- TypeScript Type Declarations
- Update Dependencies (Renovate Bot)
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
π Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. πππ
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google β€οΈ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from material-components-vue.