Replies: 1 comment 1 reply
-
In general, we may consider to add more control over the underlying events. In this specific case, we're delegating the handling of that click to react-aria, which should already stop propagation by default. See https://github.com/adobe/react-spectrum/blob/main/packages/%40react-aria/toggle/src/useToggle.ts#L54 So I'm not sure why you're seeing that behavior since stopping propagation should be the default. |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I was wondering if bento should provide an API to stop event propagation for interactive elements. Is it a pattern that a design systems should support?
I have a clickable
Card
container with aSwitch
component. Without a stop propagation in place, clicking on theSwitch
will trigger theCard
click. Even though this specific case could be arguable, I feel that propagation management can be useful for a bento consumer.My current solution is to simply wrap the interactive component with a
Box
handling the propagationShould bento provide a more integrated API to support it? For example, interactive components could have a
stopPropagation
prop specifying the event type to block.or a dedicated component replicating the
Box
approachBeta Was this translation helpful? Give feedback.
All reactions