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

Fixed copying of updated URL to clipboard when new snippets are saved #1445

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

agilityhawk
Copy link

The issue was observable under Copy to Clipboard > Medium.com / IFrame / Plain URL.

  • All three of these Components use the CopyEmbed component underneath that makes us of the asPath property of the nextrouter.
  • This property was not getting updated because we were using window.history.pushState instead of the router methods (push/replace).
  • Have used router.push here since this gets invoked only when a new snippet is created.

Caveat: Since there is a single page reload when the new snippet is created now, the page scrolls back to the top. I believe this should be a minor trade-off for making the Copy functionality work as expected.

Closes #1379

@vercel
Copy link

vercel bot commented Jan 25, 2023

@agilityhawk is attempting to deploy a commit to the Carbon Team on Vercel.

A member of the Team first needs to authorize it.

@agilityhawk
Copy link
Author

(bump). Any chance to getting this reviewed / taking it forward?

@agilityhawk
Copy link
Author

@mfix22 review/merge please?

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

Successfully merging this pull request may close these issues.

Copy Plain URL doesn't copy anything
1 participant