fix: Extend resize handle pointer target to 24px minimum - #4896
Conversation
ef59bc6 to
2159c03
Compare
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #4896 +/- ##
=======================================
Coverage 97.64% 97.64%
=======================================
Files 958 958
Lines 31247 31247
Branches 11536 11536
=======================================
Hits 30510 30510
Misses 730 730
Partials 7 7 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
|
Is it expected to change the size regardless one-theme or not? |
| cursor: nwse-resize; | ||
| position: relative; | ||
|
|
||
| // Extend the pointer target to at least 24x24px (WCAG 2.5.8) |
There was a problem hiding this comment.
Does this overlap with other elements on a page?
There was a problem hiding this comment.
No. The pseudo-element is anchored to the handle's bottom-right corner and only grows up and left, into the component's own surface, it can never extend below or to the right of the handle.
Yes, that's intentional. The audit happened to surface it under one theme, but it's a pre-existing gap in all themes, so the fix applies everywhere. Since the extension is invisible there's no visual change in any theme either. |
| position: absolute; | ||
| inset-block-end: 0; | ||
| inset-inline-end: 0; | ||
| inline-size: max(24px, 100%); |
There was a problem hiding this comment.
The icon is 16x16, but now we have a clickable area of 24x24. Should we increase the icon too? Otherwise I can start clicking and dragging at an invisible space.
There was a problem hiding this comment.
The invisible area isn't mystery space. Hovering anywhere in the extended area shows the resize cursor, like a pointer landing 4px off the icon was almost certainly aiming at it; starting the resize there is the expected outcome, not a surprise.
There was a problem hiding this comment.
It was pretty surprising to me.
| position: absolute; | ||
| inset-block-end: 0; | ||
| inset-inline-end: 0; | ||
| inline-size: max(24px, 100%); |
There was a problem hiding this comment.
It was pretty surprising to me.
Description
Extends the pointer target of the resize handle (
handle-resize-areain the internal drag-handle component, used by the code editor's resize control) to a minimum of 24x24px to meet WCAG 2.5.8 Target Size (Minimum).The extension is a transparent
::afterpseudo-element anchored to the handle's bottom-right corner, so it grows only up and left. The visible size of the handle is unchanged, and the extension never overlaps interactive elements below or to the right of the handle. The focus ring already uses::before, so there is no conflict.Related links, issue #, if available: n/a
How has this been tested?
npx jest -c jest.unit.config.js src/internal/components/drag-handle— all 147 unit tests passstylelinton the changed file passesReview checklist
The following items are to be evaluated by the author(s) and the reviewer(s).
Correctness
CONTRIBUTING.md.CONTRIBUTING.md.Security
checkSafeUrlfunction.Testing
By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.