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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Allow click events to pass through tooltip wrapped elements #1023

Merged
merged 1 commit into from
May 15, 2024

Conversation

bdow
Copy link
Contributor

@bdow bdow commented May 15, 2024

Thanks @bsholmes for the solution! 馃帀

@@ -36,7 +36,8 @@ export function Tooltip(props: TooltipProps) {
{...(!state.isOpen && typeof title === "string" ? { title } : {})}
{...tid}
// Add display contents to prevent the tooltip wrapping element from short-circuiting inherited styles (i.e. flex item positioning)
css={Css.display("contents").$}
// Once the element is `:active`, allow pointer events (i.e. click events) to pass through to the children.
css={Css.display("contents").addIn(":active", Css.add("pointerEvents", "none").$).$}
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I tried to write a test for this, but couldn't figure out how to get a click event to bubble up in tests. After 5-10minutes of searching and tryings out, I figured a manual test was good enough for now given the state of Beam soon being sunsetted.

Copy link
Contributor

@chr1sjf0x chr1sjf0x left a comment

Choose a reason for hiding this comment

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

TY @bdow

@bdow bdow merged commit b7b8f59 into main May 15, 2024
6 checks passed
@bdow bdow deleted the tooltip-click branch May 15, 2024 14:42
homebound-team-bot pushed a commit that referenced this pull request May 15, 2024
## [2.344.2](v2.344.1...v2.344.2) (2024-05-15)

### Bug Fixes

* Allow click events to pass through tooltip wrapped elements ([#1023](#1023)) ([b7b8f59](b7b8f59))
@homebound-team-bot
Copy link

馃帀 This PR is included in version 2.344.2 馃帀

The release is available on:

Your semantic-release bot 馃摝馃殌

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants