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’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(Tooltip): use popover API #2916

Open
wants to merge 24 commits into
base: next
Choose a base branch
from
Open

feat(Tooltip): use popover API #2916

wants to merge 24 commits into from

Conversation

Barsnes
Copy link
Member

@Barsnes Barsnes commented Dec 18, 2024

resolves #2897

It works like the old tooltip, but if the trigger is an element that can trigger a popover, a click will close it.
This is because we don't prevent the default event, to make sure we don't stop any events from propogating.

Copy link

changeset-bot bot commented Dec 18, 2024

🦋 Changeset detected

Latest commit: b115b69

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 4 packages
Name Type
@digdir/designsystemet-css Patch
@digdir/designsystemet-react Patch
@digdir/designsystemet Patch
@digdir/designsystemet-theme Patch

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

Copy link
Contributor

github-actions bot commented Dec 18, 2024

Preview deployments for this pull request:

Storybook - 20. Dec 2024 - 13:24

Copy link
Contributor

github-actions bot commented Dec 18, 2024

Coverage Report

Status Category Percentage Covered / Total
🔵 Lines 55.13% 3197 / 5798
🔵 Statements 55.13% 3197 / 5798
🔵 Functions 85.84% 182 / 212
🔵 Branches 77.35% 526 / 680
File Coverage
File Stmts Branches Functions Lines Uncovered Lines
Changed Files
packages/react/src/components/Tooltip/Tooltip.tsx 86.29% 81.81% 60% 86.29% 82-83, 122-125, 139-143, 193-194, 196-197, 199-200
Generated in workflow #1381 for commit b115b69 by the Vitest Coverage Report Action

@Barsnes Barsnes marked this pull request as ready for review December 19, 2024 13:11
Copy link
Collaborator

@mimarz mimarz left a comment

Choose a reason for hiding this comment

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

Safari delay is fixed but now we get that bug where we have that hidden element in down right corner somewhere after hover has shown and hide once 🙈

image

@Barsnes Barsnes marked this pull request as draft December 20, 2024 07:32
@mimarz
Copy link
Collaborator

mimarz commented Dec 20, 2024

Tooltip placement appears wrong place on in this story in Safari :/
image

@Barsnes
Copy link
Member Author

Barsnes commented Dec 20, 2024

Tooltip placement appears wrong place on in this story in Safari :/ image

Unfortunatley I can't debug safari-only issues

@Barsnes Barsnes marked this pull request as ready for review December 20, 2024 10:04
@Barsnes Barsnes requested a review from mimarz December 20, 2024 11:04
return () => {
window.removeEventListener('keydown', handleKeyDown);
};
}, []);
Copy link
Contributor

Choose a reason for hiding this comment

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

Vi trenger kanskje ikke ESC når den uansett forsvinner på blur og mouseleave? ☺️

Copy link
Member Author

Choose a reason for hiding this comment

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

Eg lurte på det også, men eg tenker kanskje det er greit å følge w3c sitt mønster, sølv om det enda er WIP

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

Successfully merging this pull request may close these issues.

Use Popover API in Tooltip
3 participants