-
-
Notifications
You must be signed in to change notification settings - Fork 32.4k
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
[docs-infra] Fix GoogleAnalytics missing event for code copy #38469
Conversation
Netlify deploy previewhttps://deploy-preview-38469--material-ui.netlify.app/ Bundle size report |
@@ -22,6 +23,7 @@ export default function CodeCopyButton(props: CodeCopyButtonProps) { | |||
className="MuiCode-copy" | |||
onClick={async (event) => { | |||
event.stopPropagation(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Very strange: Why do we stop propagation?
👍 to remove it, it seems to be fine without.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No Idea, it's been here since the creation of editable code in #34454
@bharatkashyap do you remember why you introduced it?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In the unknown, it could be nice to drop it, for the sake of learning faster. If it's really needed, we can add a comment. I don't see why it would help. stopPropagation()
are usually flags, most are harmful: https://css-tricks.com/dangers-stopping-event-propagation/.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't remember specifically adding it, 👍 to remove it.
I'll try and dig deep to find where it came from separately.
Edit: I think it came from 9017db6
34eeba2
to
4fecd05
Compare
onClick={async (event) => { | ||
event.stopPropagation(); | ||
onClick={async () => { | ||
// event.stopPropagation(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I commented such that if someone investigates a bug related to it they can get the blam easily
Related to #38421