Skip to content

useButton hook has narrower clickable area than native button elements on mobile devices #8249

@akadori

Description

@akadori

Provide a general summary of the issue here

When using the useButton hook from React Aria on mobile devices, the clickable area of the button is slightly narrower than native elements. When tapping near the edges of a button using useButton on mobile, the button visually shows the :active state (appears pressed), but the onPress handler is not triggered.

This creates a confusing user experience on mobile where visual feedback suggests the button is being tapped, but the action doesn't execute.

2025-05-16.11.18.48.mov

🤔 Expected Behavior?

When using the useButton hook from React Aria on mobile devices, the clickable area of the button should match the visual boundaries of the button element, identical to the behavior of native

elements.

😯 Current Behavior

When using the useButton hook from React Aria on mobile devices, the clickable area of the button is slightly narrower than native <button> elements. Specifically:

  • When tapping near the edges of a button implemented with useButton on mobile, the button visually shows the :active state (appears pressed), suggesting that the tap is registered
  • However, the onPress handler is not actually triggered for these edge taps
  • Native HTML <button> elements don't exhibit this issue and correctly register taps across their entire visual area

This creates a confusing user experience where users receive visual feedback suggesting their tap was successful, but the expected action doesn't occur.

💁 Possible Solution

No response

🔦 Context

No response

🖥️ Steps to Reproduce

You can observe this behavior by visiting https://akadori.github.io/react-aria-click-boundary-issue/ in Chrome's mobile device emulation mode or on an actual mobile device. The demo shows two visually identical buttons where Button B (using React Aria's useButton) has a smaller effective tap area compared to Button A (native HTML button).

Reproducing code repository: https://github.com/akadori/react-aria-click-boundary-issue

Version

[email protected]

What browsers are you seeing the problem on?

Chrome

If other, please specify.

No response

What operating system are you using?

Mac OS

🧢 Your Company/Team

No response

🕷 Tracking Issue

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions