diff --git a/.changeset/ten-snakes-play.md b/.changeset/ten-snakes-play.md new file mode 100644 index 00000000000..02db933b9ee --- /dev/null +++ b/.changeset/ten-snakes-play.md @@ -0,0 +1,5 @@ +--- +'polaris.shopify.com': patch +--- + +Updated copy url to change browser url diff --git a/polaris.shopify.com/src/components/Markdown/Markdown.tsx b/polaris.shopify.com/src/components/Markdown/Markdown.tsx index 3b135829bc3..e84dd1ee454 100644 --- a/polaris.shopify.com/src/components/Markdown/Markdown.tsx +++ b/polaris.shopify.com/src/components/Markdown/Markdown.tsx @@ -155,7 +155,8 @@ function HeadingWithCopyButton({ ? window.location.origin : 'https://polaris.shopify.com'; const path = typeof window !== 'undefined' ? window.location.pathname : ''; - const [copy, didJustCopy] = useCopyToClipboard(`${origin}${path}#${id}`); + const url = `${origin}${path}#${id}`; + const [copy, didJustCopy] = useCopyToClipboard(url); return ( @@ -164,7 +165,15 @@ function HeadingWithCopyButton({ ariaLabel="Copy to clipboard" renderContent={() =>

{didJustCopy ? 'Copied' : 'Copy'}

} > -