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
Conversation
@@ -81,6 +82,8 @@ const Tooltip: React.FC<TooltipOwnProps> = (props) => { | |||
} else if (state === 'closed') { | |||
setStateAttribute('closed'); | |||
} | |||
} else { | |||
setStateAttribute('closed'); |
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.
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.
c12f873
to
aa67e63
Compare
c1ba72c
to
f56efb4
Compare
@@ -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 { |
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.
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).
# 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)
main
once [Tooltip] Improve on custom durations + fixes #554 is merged.I'll add versions file after the above is merged ☝️
Closes #459