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

[Bug Report] v-tooltip does not work when activator is set using the new slot syntax #6440

Closed
K900 opened this issue Feb 10, 2019 · 14 comments · Fixed by #6502
Closed

[Bug Report] v-tooltip does not work when activator is set using the new slot syntax #6440

K900 opened this issue Feb 10, 2019 · 14 comments · Fixed by #6502

Comments

@K900
Copy link

K900 commented Feb 10, 2019

Versions and Environment

Vuetify: 1.5.0
Last working version: 1.4.0
Vue: 2.6.4
Browsers: Firefox 67.0, Microsoft Edge, Mozilla Firefox, Google Chrome
OS: Windows 10, Linux

Steps to reproduce

Change the template from <template slot="activator"> to <template #activator>.

Expected Behavior

Tooltip still appears when activator is hovered.

Actual Behavior

Tooltip does not appear.

Reproduction Link

https://jsfiddle.net/d9qc0n26/1/

@KaelWD
Copy link
Member

KaelWD commented Feb 10, 2019

They aren't equivalent, #activator is a scoped slot. The correct way to do it: https://jsfiddle.net/5yvr0skb/

@K900
Copy link
Author

K900 commented Feb 10, 2019

If I understand things correctly, the latest Vue update made it so #slots without arguments behave equivalently to old-style non-scoped slots.

@KaelWD
Copy link
Member

KaelWD commented Feb 10, 2019

True, but that's supposed to be for backwards compatibility with existing components. That differentiation won't be available in vue 3, so it's best that we only support the new scoped use with v-slot. I can add a warning if v-slot:activator is used without arguments if that helps.

KaelWD added a commit that referenced this issue Feb 12, 2019
also added warning if #activator is used without binding (#6440)
@DRoet
Copy link
Contributor

DRoet commented Feb 12, 2019

@KaelWD is this something that can be improved in 2.0 or are we forever stuck with this syntax? if so I'll just ignore the warning thrown in 1.5.1

@buzzzzer
Copy link

@KaelWD
v-slot:activator="data" & v-on="data.on" - this syntax will stay or something else will change ?

upgrade 1.5.0 to 1.5.1 have breaking change for those, who used new slot syntax

@KaelWD
Copy link
Member

KaelWD commented Feb 13, 2019

I do agree that it's rather verbose, I'll see if there's anything else we can do for future versions.

just ignore the warning

The warning means it isn't working

breaking change for those, who used new slot syntax

No it isn't, it was working correctly in 1.4.x with the 2.6 beta until vue changed how slots work again with the other 2.6.x patches.

@DRoet
Copy link
Contributor

DRoet commented Feb 13, 2019

@KaelWD yeah I noticed that about the warning. I think he means that in 1.5.0 u could just use the v-slot:activator syntax without binding the data. in 1.5.1 this breaks.

edit: https://codepen.io/anon/pen/omyjyq?&editable=true&editors=101 this breaks in 1.5.1

@buzzzzer
Copy link

buzzzzer commented Feb 13, 2019

No it isn't, it was working correctly in 1.4.x with the 2.6 beta until vue changed how slots work again with the other 2.6.x patches.

after upgrade from 1.5.0 to 1.5.1 v-slot:activator without ="data" and v-on="data.on" on v-menu and v-tooltip are broken
v-speed-dial now have v-slot:activator without ="data"

@KaelWD
Copy link
Member

KaelWD commented Feb 13, 2019

That was a bug, if you set vue to 2.6.1 and vuetify 1.5.0 it works the same as now. You couldn't use slot="activator" slot-scope="data" with 2.6.4/1.5.0.

@DRoet
Copy link
Contributor

DRoet commented Feb 13, 2019

true, but vue 2.6.4 allowed for backwards compat on this.$slots so using a simple <template #activator> worked (in 1.5.0). however this broke in 1.5.1

@KaelWD
Copy link
Member

KaelWD commented Feb 13, 2019

It was never intended to work. I can tell the difference between the two if I wanted but that possibility will be removed in vue 3.0 so it's best if those migrating to the new syntax use the one that will keep working.

@DRoet
Copy link
Contributor

DRoet commented Feb 13, 2019

Fair enough, I'm all for looking ahead (3.0), but at the same time it might seem odd that Vue itself allows for backwards compat in >= 2.6.4, But vuetify doesn't, no?

@KaelWD
Copy link
Member

KaelWD commented Feb 13, 2019

Vue itself allows for backwards compat

Not if you're already using both slots and scopedSlots, I've had to pull some really weird shit to get that to work. The backwards compat is more for old components that aren't updated to use $scopedSlots

See vuejs/vue#9421, vuejs/vue#9458 (comment) for more.

@DRoet
Copy link
Contributor

DRoet commented Feb 13, 2019

tragic, guess I'll just have to bite the bullet on this syntax, I guess this issue can be closed?

@lock lock bot locked as resolved and limited conversation to collaborators Feb 29, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants