feat(components): Popover exit animation#254
feat(components): Popover exit animation#254Denny09310 wants to merge 7 commits intoLumexUI:mainfrom
Conversation
|
Important Review skippedDraft detected. Please check the settings in the CodeRabbit UI or the You can disable this status message by setting the ✨ Finishing touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Codecov Report❌ Patch coverage is
Additional details and impacted files☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Hey @Denny09310,
Thanks for this PR! This is something I’ve been meaning to get to for a long time but never quite managed.
I got a bit sick, so I couldn’t check it out earlier.
I have a couple of concerns:
- I don't think we need a new
AnimationEventArgsat all; onanimationendis already a valid event;- The popover should be removed from the DOM after exit;
- In general, I'd handle this just like I did with collapse (via intermediate states, such as expanded -> collapsing -> collapsed). Even then, the current solution isn’t ideal since the transition can’t be interrupted if the user spams clicks;
Because of this, I’d probably put this on hold for now.
What I really want is for the animation to be interruptible. For that, we should rely on transitions, since they are inherently interruptible. Keyframes, on the other hand, restart every time they’re triggered, which doesn’t look great.
What do you think?
|
I think it’s perfect. This was just the first approach I came up with, and I wanted your opinion on it. I haven’t found a better method to add an animation that also removes the element from the DOM afterward, but I like your idea more. To have the ability to interrupt the animation would be ideal |
|
Great! You might have noticed that I created a Blazor port of React Sonner. I went with So the flow would look something like this:
|
| State = PopoverState.Opening; | ||
| await InvokeAsync( StateHasChanged ); | ||
|
|
||
| await Task.Delay( 100 ); // <-- I don't know how to avoid this. The animation works from the second time forward |
There was a problem hiding this comment.
Please see this comment. I don't know how to solve it
Description
Add the ability to have a popover exit animation.
What's been done?
Checklist
Additional Notes
There is one test that the dropdown is failing even though visually it works well.