Giter Site home page Giter Site logo

Comments (4)

bbohlender avatar bbohlender commented on August 16, 2024

I think normal onPointerOver events are a better fit for this use case. on[X]Change are currently really just listeners for the respective signals used under the hood to have the respective conditional properties

from uikit.

wrangelvid avatar wrangelvid commented on August 16, 2024

I should've been more precise in requesting this only for onHoverChange, onActiveChange and onFocusChange and not all conditionals. The Interactivity tutorial states that all UI elements can receive events like other r3f elements but extends it with hover and active. That implication makes it natural to include the pointer events into these. Then the Event Properties could document on[Hover/Active/Focus]Change while hover, active, and focus remain in the conditionals.

from uikit.

bbohlender avatar bbohlender commented on August 16, 2024

onHoverChange etc should imo not receive an event because that leads people to believe onHoverChange is a combination of onPointerOver & onPointerOut. However, the hover state is much more complex as it tracks the amount of pointer that are currently hovering and only changes the hover state if the amount is or is not greater than 0.

Your example use case is not fitting here, because in a case where the user is hovering with 1 pointer where no additional button is pressed and then also hovering with another pointer (e.g. controller) with a specific button pressed onHoverChange is only executed initially and only the initial event would be provided. Therefore the developer would not be notified of the second pointer and its event. This illustrates my point where I fear that people can confuse onHoverChange etc with the actual pointer event which is what should be used for your presented use case.

If you find a use case where having the initial and last event for the hover etc. change is necassary, please let me know :)

from uikit.

wrangelvid avatar wrangelvid commented on August 16, 2024

That makes sense, thank you for the clarification.

from uikit.

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.