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

Add unique keys to clones #84

Merged
merged 3 commits into from
Aug 31, 2022
Merged

Add unique keys to clones #84

merged 3 commits into from
Aug 31, 2022

Conversation

weotch
Copy link
Member

@weotch weotch commented Aug 31, 2022

@ErriourMe, @leo-rojas can you let me know if this fixes the duplicate key issue you reported? You should be able to install it by changing your package.json version constraint to like:

"vue-ssr-carousel": "BKWLD/vue-ssr-carousel#unique-keys-on-clones"

Here's the Vue inspector showing the new key suffixes

vue-ssr-carousel demo 2022-08-30 at 5 04 38 PM

@netlify
Copy link

netlify bot commented Aug 31, 2022

Deploy Preview for vue-ssr-carousel ready!

Name Link
🔨 Latest commit 93cdad0
🔍 Latest deploy log https://app.netlify.com/sites/vue-ssr-carousel/deploys/630ea711aa9abc0009071660
😎 Deploy Preview https://deploy-preview-84--vue-ssr-carousel.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site settings.

@ErriourMe
Copy link

Works fine!
But I found new problem with component in slide and clones (not affiliated with this bug). I will create new issue.

@weotch weotch merged commit 8ac485c into main Aug 31, 2022
@weotch weotch deleted the unique-keys-on-clones branch August 31, 2022 16:20
@leo-rojas
Copy link

@weotch hey, thanks for the update. It was still happening for me, but I noticed it was only showing the error for when a key was 0. For mine I was just looping through an array and using the array indexes for keys. I added 1 to every key to prevent having a 0 key and that fixed it.

@weotch
Copy link
Member Author

weotch commented Sep 1, 2022

Oh shoot, yeah, I guess if it's 0 then this line would not pass. I should change that to vnode.key != null or something like that.

if isPeekingClone and vnode.key

weotch added a commit that referenced this pull request Sep 1, 2022
@weotch
Copy link
Member Author

weotch commented Sep 1, 2022

Ok, that's fixed in 1.5.1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants