Skip to content

feat(switch): ensure minimum 48x48 hit target for better accessibility #3517

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

Merged
merged 7 commits into from
Feb 23, 2025

Conversation

devin-ai-integration[bot]
Copy link
Contributor

@devin-ai-integration devin-ai-integration bot commented Feb 19, 2025

Description

Improves Switch component accessibility by ensuring a minimum touch target size of 48x48 pixels while allowing custom hitSlop overrides.

Changelog

Switch: Added default 48x48 touch target with support for custom hitSlop overrides

Additional info

MADS-4591

Copy link
Contributor Author

🤖 Devin AI Engineer

I'll be helping with this pull request! Here's what you should know:

✅ I will automatically:

  • Address comments on this PR. Add "(aside)" to your comment to have me ignore it.
  • Look at CI failures and help fix them

Note: I can only respond to comments from users who have write access to this repository.

⚙️ Control Options:

  • Disable automatic comment and CI monitoring

@nitzanyiz nitzanyiz self-assigned this Feb 23, 2025
@nitzanyiz nitzanyiz requested a review from M-i-k-e-l February 23, 2025 09:54
@nitzanyiz nitzanyiz assigned M-i-k-e-l and unassigned nitzanyiz Feb 23, 2025
@nitzanyiz
Copy link
Collaborator

Please update the pr description according to our template.

Comment on lines +159 to +162
top: verticalPadding,
bottom: verticalPadding,
left: horizontalPadding,
right: horizontalPadding
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The user should be allowed to override the hitSlop

@nitzanyiz
Copy link
Collaborator

TouchableOpacity already has hitSlop in its props. So its already typed and the user can pass it. The {...others} spread of the props will have it so just passing hitSlop before this will override the hitSlop if its passed in the props. Please fix that

@M-i-k-e-l M-i-k-e-l merged commit d6c2579 into master Feb 23, 2025
1 check passed
@M-i-k-e-l M-i-k-e-l deleted the devin/1739967754-switch-hit-target branch February 23, 2025 14:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants