Giter Site home page Giter Site logo

Comments (5)

theKashey avatar theKashey commented on May 27, 2024

The funny thing - it's working that way only for Enter, not for Space.

from react-focus-on.

narehart avatar narehart commented on May 27, 2024

Maybe that's because of the way React handles onClick handlers. They are also triggered by the Enter key. My guess is this uses the keyup event under the hood. So I think what's happening here is the onKeyDown opens FocusOn which moves focus to the button and then when the key is released the onClick or onKeyUp event is fired which both use keyup.

from react-focus-on.

narehart avatar narehart commented on May 27, 2024

If I defer rendering of the onFocus to the end of the event loop it doesn't trigger the onClick handler: https://codesandbox.io/s/divine-flower-jq4rn

from react-focus-on.

theKashey avatar theKashey commented on May 27, 2024

Let me create issue for React then. It shall not be solved here.

from react-focus-on.

stale avatar stale commented on May 27, 2024

This issue has been marked as "stale" because there has been no activity for 2 months. If you have any new information or would like to continue the discussion, please feel free to do so. If this issue got buried among other tasks, maybe this message will reignite the conversation. Otherwise, this issue will be closed in 7 days. Thank you for your contributions so far.

from react-focus-on.

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.