Snackbar: Keep visible while touched or hovered#8334
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## dev #8334 +/- ##
==========================================
+ Coverage 88.64% 88.90% +0.25%
==========================================
Files 407 407
Lines 12179 12218 +39
Branches 2431 2440 +9
==========================================
+ Hits 10796 10862 +66
+ Misses 858 828 -30
- Partials 525 528 +3 ☔ View full report in Codecov by Sentry. |
|
We would need to cover the new lines with unit tests, if possible to simulate that the mouse is on the snackbar. |
|
I think this is a pretty useful feature and I'd say we can even make it the default. I mean, what is the worst that can happen to any existing apps, that the user hovers over a message and it will not fade. I wouldn't call that a breaking change. Parameter name ideas: |
|
|
|
So remove the option and make this new behavior hardcoded? Everything else looks good? Does anyone has pointers on testing mouse hover and touches? |
|
@danielchalmers what about the use-case of clicking a snackbar message to hide it? That would collide with this new behavior, right? |
Any mouse or touch event can be simulated easily in bUnit. |
That will perform the same action as the close button and is thus uncancellable and ignores further interaction. |
|
So how do you do it on mobile? Touch and keep touching to keep the message from hiding? |
A touch will keep it visible until somewhere else is touched |
|
Doesn't bUnit have the MouseOver / MouseOut methods? https://bunit.dev/api/Bunit.MouseEventDispatchExtensions.html |
Ok, I think in this scenario there is a collision between the use-cases and we would need the property. Some may want to just touch messages to make them go away on mobile. |
Video3.mp4 |
|
@danielchalmers Does this PR change the touch interaction? Touching twice to close a Snack bar would cause confusion. |
just posted an example above. clicking/touching a clickable snackbar still closes it like normal. touching a regular snackbar keeps it open. anything that calls the close event will not let the animation be cancelled i did not intend on making any UI/UX breaking changes so if any are found I will fix them |
|
Sounds good, as long as it is well documented. |
I will try to look it tmr |
For instance the difference in behavior between closable and non-closable snackbar messages could be explained. And just to make it clear, I think from the discussion we can follow that we don't need a property to disable this new behavior as it doesn't interfere with closable messages. Do you agree @mikes-gh and @ScarletKuro? Thumbs up if you agree please. |
|
May I suggest a little refinment? Change: |
Close click animation wasn't forced to play and was respecting pause
|
@henon @ScarletKuro Thank you so much for the work on #8281 I've done more on the snackbar and added comprehensive tests. Should be ready! |
|
Thanks Daniel |
* Keep Snackbar open while touched or hovered * @ontouchcancel * Fix ghosts by always giving close action priority * Use better event dotnet/aspnetcore#13104 (comment) * Comprehensive hover and touch tests * Fix ghosts when leaving mouse over during close Close click animation wasn't forced to play and was respecting pause



Description
Resolves #6764
How Has This Been Tested?
visually
Types of changes
Snackbar will now go visible and stay like that if the mouse enters or touched. When left, it will finish the rest of the visible duration then start the hide animation.
onmouseover, onmouseleave
Video3.mp4
ontouchstart, ontouchend
Video3.mp4
Checklist:
dev).