-
Notifications
You must be signed in to change notification settings - Fork 170
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
fix: Require less cursor precision when moving from tooltip target to tooltip content #3359
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #3359 +/- ##
==========================================
+ Coverage 96.46% 96.50% +0.03%
==========================================
Files 805 804 -1
Lines 23029 23004 -25
Branches 7969 7543 -426
==========================================
- Hits 22215 22199 -16
- Misses 760 798 +38
+ Partials 54 7 -47 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
fdfaa81
to
d96b5e9
Compare
src/popover/container.scss
Outdated
&::before { | ||
inset-block: 0; | ||
inset-inline-start: -$arrow-height; | ||
block-size: $arrow-height; |
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.
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.
Yeah, whoops, good find - I messed up the logical properties. Fixed and manually tested more cases, so new approval request coming soon.
4c28834
to
4d878ab
Compare
4d878ab
to
d16c085
Compare
})} | ||
style={{ | ||
[customCssProps.sliderTooltipPosition]: `calc(${percent}% - ${thumbSize}px)`, | ||
onMouseEnter={() => { |
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.
There is now a sort of intermediate state in the slider where the tooltip is already open but the handle is not shown in hover state. This did not occur before —tooltip appearing and handle in hover state would always happen at the same time.
slider-tooltip-hover.mov
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.
That intermediate state is what this PR explicitly enables - the whole idea is to allow the cursor to move off the slider handle and then into the tooltip much easier. I don't think it should show hover styling when the mouse is no longer on the handle, so this means that intermediate state has to exist.
Description
For accessibility reasons, you should be allowed to move your cursor from the tooltip trigger to the tooltip itself. And you can't do that in the slider. And you can also do that in other components, but you have to gently maneuver your cursor from the trigger through the arrow and into the tooltip, but that feels needlessly precise. So we create an extension to the tooltip's bounding box that extends the full height/width of the tooltip but covers the empty space next to the arrow.
Slider needed a little more attention because it the mouseenter/mouseleave handlers were placed on an element too far away from where the tooltip was actually being rendered. So I just moved those handlers out to a parent div (new div because I guess the intention is to not make the logic cover the step labels).
Related links, issue #, if available: AWSUI-60211, AWSUI-60222
How has this been tested?
Manually. There should be no visual or behavioral changes, only the sizes of the mouseover/mouseout triggers.
Review checklist
The following items are to be evaluated by the author(s) and the reviewer(s).
Correctness
CONTRIBUTING.md
.CONTRIBUTING.md
.Security
checkSafeUrl
function.Testing
By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.