react-spectrum icon indicating copy to clipboard operation
react-spectrum copied to clipboard

[RAC] setting "hovered" modifier on button from dev tools does not trigger hover state

Open agos opened this issue 1 year ago โ€ข 1 comments

Provide a general summary of the issue here

Browser dev tools "elements" tab usually have the option to simulate hover on an element. this is particularly useful to debug hover styles. When using this feature with a react-aria Button, it does not work: the data-hovered attribute is not applied.

๐Ÿค” Expected Behavior?

When forcing hovered state from browser developer tools, the data-hovered attribute is applied

๐Ÿ˜ฏ Current Behavior

Nothing changes

๐Ÿ’ Possible Solution

no idea, sorry

๐Ÿ”ฆ Context

this makes it unnecessarily hard to debug hover styles. the data-hovered attribute can still be applied manually, but it's way less convenient

๐Ÿ–ฅ๏ธ Steps to Reproduce

  • go here https://react-spectrum.adobe.com/react-aria-tailwind-starter/index.html?path=/docs/button--docs
  • inspect the button
  • force hover state

Version

1.2.1

What browsers are you seeing the problem on?

Chrome, Safari

If other, please specify.

No response

What operating system are you using?

MacOS

๐Ÿงข Your Company/Team

No response

๐Ÿ•ท Tracking Issue

No response

agos avatar Jun 11 '24 07:06 agos

Thanks for the issue. Please see this post for why the library acts as it does. https://react-spectrum.adobe.com/blog/building-a-button-part-2.html

And for testing purposes and debugging, please see https://github.com/adobe/react-spectrum/issues/6198

snowystinger avatar Jun 11 '24 11:06 snowystinger

Closing as working as intended

snowystinger avatar Apr 08 '25 06:04 snowystinger