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
added check for componentOptions existing on slot fixes #6901 #6905
Conversation
This pull request is automatically deployed with Now. |
Codecov Report
@@ Coverage Diff @@
## master #6905 +/- ##
======================================
Coverage 85.3% 85.3%
======================================
Files 298 298
Lines 7221 7221
Branches 1804 1804
======================================
Hits 6160 6160
Misses 960 960
Partials 101 101
Continue to review full report at Codecov.
|
@@ -65,7 +65,7 @@ export default { | |||
if (this.isActive) { | |||
let btnCount = 0 | |||
children = (this.$slots.default || []).map((b, i) => { | |||
if (b.tag && b.componentOptions.Ctor.options.name === 'v-btn') { | |||
if (b.tag && typeof b.componentOptions !== 'undefined' && b.componentOptions.Ctor.options.name === 'v-btn') { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if (b.tag && typeof b.componentOptions !== 'undefined' && b.componentOptions.Ctor.options.name === 'v-btn') { | |
if (b.tag && typeof b.componentOptions && b.componentOptions.Ctor.options.name === 'v-btn') { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should probably be any non-empty vnode, dunno why it singles out buttons.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@johnleider is this typescript specific?
in javascript typeof something
results in a string 'undefined'
And then it would always results in true because it's a string.
Anyway the code you suggested results in the same error.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@KaelWD Could you tell me how to do that? Your solution sounds better, if i understand it correctly you mean that we change the if to check if there is any vuetify component (starts with v-
)
Perhaps we should ask @kuromoka and @sh7dm if there was any particular reason for this
dunno why it singles out buttons.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
My suggested change was merely for style purposes. As far as @KaelWD 's suggestion. This is used in a few places, maybe it's time to normalize the functionality into a helper of sorts.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi John,
But when i apply your auggestion and test it, it breaks.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
check if there is any vuetify component (starts with v-)
any element, not just vuetify components
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How could i get this PR accepted?
there is a lot of discussion and good suggestions, but nothing specific.
John's comment breaks code and i don't get what is better about it since only !== 'undefined'
is removed.
Kael's comment is a really good suggestion, but i don't know how to implement that.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm facing same issue and code change above fixes it
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
My suggestion was just to change the compare logic. If it doesn't work, so be it.
As far as getting this accepted, I'd say that this works and let's get it in.
Description
Adding a
typeof !== 'undefined'
check so only slots withcomponentOptions
will be adding an animation.Motivation and Context
it fixes #6901
How Has This Been Tested?
I've tested this in my project with the same code as the issues codepen: https://codepen.io/anon/pen/BENVJK?editors=1111
and with the playground as documented below
Markup:
Child.vue
Types of changes
Checklist:
master
for bug fixes and documentation updates,dev
for new features and breaking changes).No documentation needed