Skip to content
This repository was archived by the owner on Apr 6, 2023. It is now read-only.

fix(nuxt): avoid head dom update on same route click#8206

Merged
pi0 merged 5 commits intonuxt:mainfrom
harlan-zw:fix/head-ensure-paused
Oct 15, 2022
Merged

fix(nuxt): avoid head dom update on same route click#8206
pi0 merged 5 commits intonuxt:mainfrom
harlan-zw:fix/head-ensure-paused

Conversation

@harlan-zw
Copy link
Copy Markdown
Collaborator

@harlan-zw harlan-zw commented Oct 14, 2022

🔗 Linked issue

resolves nuxt/nuxt#15159

❓ Type of change

  • 📖 Documentation (updates to the documentation or readme)
  • 🐞 Bug fix (a non-breaking change that fixes an issue)
  • 👌 Enhancement (improving an existing functionality like performance)
  • ✨ New feature (a non-breaking change that adds functionality)
  • ⚠️ Breaking change (fix or feature that would cause existing functionality to change)

📚 Description

There are two issues present:

  1. The DOM is updated when the user clicks a route they are already on (fixed in this PR)
  2. children is being reset before the dom re-render. Fixed here: fix: ensure tags props are immutable vueuse/head#139 and is available the latest @vueuse/head RC (have bumped in this PR)

Have confirmed that either of these fixes the issue in this test.

📝 Checklist

  • I have linked an issue or discussion.
  • I have updated the documentation accordingly.

@codesandbox
Copy link
Copy Markdown

codesandbox Bot commented Oct 14, 2022

CodeSandbox logoCodeSandbox logo  Open in CodeSandbox Web Editor | VS Code | VS Code Insiders

@netlify
Copy link
Copy Markdown

netlify Bot commented Oct 14, 2022

Deploy Preview for nuxt3-docs canceled.

Name Link
🔨 Latest commit 6020610
🔍 Latest deploy log https://app.netlify.com/sites/nuxt3-docs/deploys/634ae67b07e34500085dde5a

@harlan-zw harlan-zw changed the title fix(nuxt): ensure dom updates are paused before unpausing fix(nuxt): avoid head dom update on same route click Oct 14, 2022
Copy link
Copy Markdown
Member

@pi0 pi0 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@pi0 pi0 requested a review from danielroe October 15, 2022 11:15
@pi0 pi0 merged commit c0e9f42 into nuxt:main Oct 15, 2022
@pi0 pi0 mentioned this pull request Oct 18, 2022
@danielroe danielroe added the 3.x label Jan 19, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

useHead styles innerHTML clears when repeating router push on currently set route

3 participants