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

Fix copy button copying outdated snippet #18888

Merged
merged 2 commits into from
Sep 13, 2022

Conversation

pocka
Copy link
Contributor

@pocka pocka commented Aug 8, 2022

Issue: #18829

What I did

Fixed a bug copied code snippet is outdated by adding a missing useCallback dependency for snippet copy functionality.

I think we should include this patch in a v6.5 release as well.

How to test

  • Is this testable with Jest or Chromatic screenshots?
  • Does this need a new example in the kitchen sink apps?
  • Does this need an update to the documentation?

If your answer is yes to any of these, please make sure to include it in your PR.

#18829

Fixed a regression introduced in 5f5cf81.

`highlightableCode` was missing in dependencies array therefore
the copied code snippet was fixed to the first-rendered one.
@pocka pocka changed the title fix(components): Fix copy button copies outdated snippet Fix copy button copying outdated snippet Aug 8, 2022
@pocka pocka marked this pull request as ready for review August 8, 2022 13:29
# Conflicts:
#	code/lib/components/src/syntaxhighlighter/syntaxhighlighter.tsx
})
.catch(logger.error);
},
[highlightableCode]
Copy link
Member

Choose a reason for hiding this comment

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

this is the only real change.. everything else is just formatting

@ndelangen ndelangen merged commit ae61864 into next Sep 13, 2022
@ndelangen ndelangen deleted the pocka/fix/18829-outdated-snippet-copied branch September 13, 2022 14:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants