Giter VIP home page Giter VIP logo

Comments (4)

reidbarber avatar reidbarber commented on June 19, 2024

I think it's preferable to use the pressed: variant from the plugin in place of tailwind's default active: variant. You'll get more consistent behavior across input modalities, and this should also fix your issue due to how they're ordered in the plugin. I think the behavior you're seeing is expected, since :active and [data-hovered] have the same specificity, it comes down to which comes last in the stylesheet, which would be [data-hovered] since it comes from the plugin.

from react-spectrum.

imericxu avatar imericxu commented on June 19, 2024

I understand the benefits that pressed offers, however, the issue is that the plugin is disrupting the expected behavior, i.e., adding the plugin shouldn’t change existing behavior. In this case, the native hover state is being used because <button> doesn’t have a programmatic isHovered state. It seems like the native :hover selector’s precedence is modified by the plugin, so it only makes sense that the :active selector’s precedence is modified accordingly, even though the selector is discouraged, to maintain consistent behavior.

The specific use case where I want to keep using the :active state is with links because the link components and press removes the native drag and drop ability.

from react-spectrum.

reidbarber avatar reidbarber commented on June 19, 2024

The only potential solution I can think of is specifying a custom variant order in the plugin.

from react-spectrum.

k-miyata avatar k-miyata commented on June 19, 2024

Prefixing all React Aria Components modifiers can resolve this issue.

from react-spectrum.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.