Skip to content

NumberField button stays on data-pressed state even after the press has been released #9994

@DarkstarXDD

Description

@DarkstarXDD

Provide a general summary of the issue here

data-pressed attribute isn't removed from the button inside the NumberField when the button gets disabled.

rac-numberfield-issue.mp4

🤔 Expected Behavior?

data-pressed should be removed from the element once the mouse/touch is released.

😯 Current Behavior

data-pressed statys on the element even after the mouse/touch is released. It's only removed from the element when another click event is registered somewhere on the page.

💁 Possible Solution

No response

🔦 Context

No response

🖥️ Steps to Reproduce

https://stackblitz.com/edit/vitejs-vite-o2utfctn?file=src%2FApp.tsx

I have given the red color for data-pressed state. The NumberField has a minValue=0. If you press the decrement button for the value to go to 0 you will see the red color is still present on the button even after you have released the mouse. It will be removed only when you click somewhere else on the page.

You can see this issue on the docs examples as well but the pressed colors were not very obvious there, so I used this demo setup.

Version

1.17.0

What browsers are you seeing the problem on?

Chrome

If other, please specify.

Firefox

What operating system are you using?

Windows 11

🧢 Your Company/Team

No response

🕷 Tracking Issue

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions