-
Notifications
You must be signed in to change notification settings - Fork 34
feat(#2361): increase clickable area for radio and checkbox #3099
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
base: alpha
Are you sure you want to change the base?
Conversation
5d8fd63 to
79bcb45
Compare
79bcb45 to
ef25ab4
Compare
| /* Container */ | ||
| .container { | ||
| position: relative; |
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.
Only with Safari, when I am having a checkbox, and when I click on it, there is a light "shift" 22px to 24px around the checkbox, like the below video. Safari I am testing both 17.4.1 and 18.4 (browserstack)
checkbox-safari.mov
| // - matrix\(1, 0, 0, 1, = identity matrix | ||
| // - -2[0-9.]+ = negative number starting with -2 (e.g., -22, -23.6) | ||
| // - Flexible pattern accounts for border widths and sub-pixel rendering | ||
| expect(beforeStyles.transform).toMatch(/matrix\(1, 0, 0, 1, -2[0-9.]+, -2[0-9.]+\)/); |
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.
This is extremely specific and I think very brittle. After the tests above, I'm not sure this is adding anything useful, and would make the test far more brittle than I would like.
| // - (-22, -22) = translate by -22px in X and Y directions | ||
| // Math: 50% of 44px = 22px, so translate(-50%, -50%) = translate(-22px, -22px) | ||
| // This centers the 44px touch target on the 24px icon | ||
| expect(beforeStyles.transform).toBe("matrix(1, 0, 0, 1, -22, -22)"); |
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.
Same comment as the one I made for the Checkbox tests
Before (the change)
After (the change)
Make sure that you've checked the boxes below before you submit the PR
Steps needed to test
For testing, you can add a border to the newly added styles in
::beforeand visually verify the increased clickable area, as in the screenshot below