-
Notifications
You must be signed in to change notification settings - Fork 42
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
♻️ Ny utility composeEventHandlers
#2610
Conversation
🦋 Changeset detectedLatest commit: eb049a3 The changes in this PR will be included in the next version bump. This PR includes changesets to release 7 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
Storybook demoEndringer til review: 17c2d02b8c | 61 komponenter | 401 stories |
if ( | ||
checkForDefaultPrevented === false || | ||
!(event as unknown as Event).defaultPrevented | ||
) { | ||
return ourEventHandler?.(event); |
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.
Det at vi nå lytter til defaultPrevented
flere steder kan vel i teorien brekke ting...? Men det å gjøre preventDefault()
har vel ikke hatt noen effekt tidligere, så det er vel usannsynlig at folk har gjort det? (Ble mye "vel" her 😅)
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.
Ja endringen har potensiale for å kunne brekke noe, selv om det vil være edgecaser 🤔 Er med på å stashe denne på en v6-branch hvis vi ikke ønsker å risikere det som en minor-versjon
Co-authored-by: Halvor Haugan <83693529+HalvorHaugan@users.noreply.github.com>
Description
Det oppstår ofte tilfeller der vi overskriver eventhandlers for komponenter. I de tilfellene kjører vi ofte
props.onClick
eller lignende. For å forenkle denne logikken og sikre at dette blir kjørt likt på tvers av systemet kan dacomposeEventHandlers
tas i bruk;