-
-
Notifications
You must be signed in to change notification settings - Fork 32.3k
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] Prevent link anchor when selecting text #41994
Conversation
Netlify deploy previewhttps://deploy-preview-41994--material-ui.netlify.app/ Bundle size report |
b40c3fe
to
7c8de6b
Compare
Signed-off-by: Alexandre Fauquette <[email protected]>
@@ -717,7 +717,7 @@ export default function DemoToolbar(props) { | |||
DemoToolbar.propTypes = { | |||
codeOpen: PropTypes.bool.isRequired, | |||
codeVariant: PropTypes.string.isRequired, | |||
copyButtonOnClick: PropTypes.object.isRequired, | |||
copyButtonOnClick: PropTypes.func.isRequired, |
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.
Nice! I was about to open a PR to fix this prop type 👏
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.
Some time I open my dev tools and spot warning errors 😁
Cool, the UX looks as good as it could be ✨ I noticed a couple of ways we can improve this: #42593. |
Signed-off-by: Alexandre Fauquette <[email protected]>
Fix #39350, solving #39603 (review)
The prevent default is weird, because if we use the
documents.addEventlistner
to triggerevent.preventDefault()
the link is still working 🙈Did not found the why, so I just moved to the simplest approach: loop over links and add the event listener.
Screencast.from.16-05-2024.11.37.07.mp4