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

[Tooltip] Add unmount animation support #558

Merged
merged 3 commits into from Mar 19, 2021
Merged

Conversation

benoitgrelard
Copy link
Collaborator

@benoitgrelard benoitgrelard commented Mar 15, 2021



I'll add versions file after the above is merged ☝️


Closes #459

@@ -81,6 +82,8 @@ const Tooltip: React.FC<TooltipOwnProps> = (props) => {
} else if (state === 'closed') {
setStateAttribute('closed');
}
} else {
setStateAttribute('closed');
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

The key fix here was this to ensure only one tooltip remain open at once because we had an issue where the state attribute was the same on all instances.

I thought I had fixed it in previous PRs by adding the check for the tooltip id, but we also want to make sure if it's not this particular tooltip, it should be considered closed.

Base automatically changed from tooltip-timings-2 to main March 19, 2021 18:23
@@ -100,9 +101,11 @@ const Tooltip: React.FC<TooltipOwnProps> = (props) => {
if (context.id === contentId) {
if (state === 'open') {
setStateAttribute(context.delayed ? 'delayed-open' : 'instant-open');
} else if (state === 'closed') {
} else {
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Removed this explicit check, that's what was breaking the unmount animation. It was there because that PR was based on having only open and closed state, but now that we have more it should go (wasn't needed anyway).

@benoitgrelard benoitgrelard merged commit fb723f4 into main Mar 19, 2021
@benoitgrelard benoitgrelard deleted the tooltip-presence branch March 19, 2021 18:55
benoitgrelard added a commit that referenced this pull request Mar 22, 2021
# New features

Breaking changes are indicated with a 🔥 icon.

[Tooltip] Add custom duration support (#550, #551, #554, #558)
[Tooltip] Add unmount animation support (#558)
[Toggle] Rename `ToggleButton` primitive to `Toggle` and `toggled` to `pressed` (#546) 🔥
[ToggleGroup] New primitive! (#376) 🎉

# Fixes

[ContextMenu] Ensure you can open a context menu when one is already open (#565)
[Popper] Fix potential issues with non-measured positioning (#541)
[Presence] Fix unmount hanging (#548)
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.

[Tooltip] Consider allowing forceMount and Presence
2 participants