Comments (5)
The funny thing - it's working that way only for Enter
, not for Space
.
from react-focus-on.
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.
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.
Let me create issue for React then. It shall not be solved here.
from react-focus-on.
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)
- Mixed module semantics breaks rollup build HOT 2
- as={Component} not exposed from react-focus-lock HOT 5
- onClickOutside is never triggered with React portals HOT 3
- Allow `style` prop on <FocusOn /> HOT 1
- Use with react-transition-group doesn't clear aria-hidden attributes HOT 2
- Scroll lock prevents multi-touch zoom and back functionality HOT 6
- React-focus-lock dependency HOT 2
- Update aria-hidden to v. 1.1.3 to fix an IE11 incompatibility issue HOT 1
- Can't resolve tslib HOT 1
- Console error [Intervention] HOT 1
- Shadow DOM HOT 5
- How to preventDefault? HOT 4
- Heading, paragraph text are not selectable inside `FocusOn` HOT 3
- React@17 event delegation issue HOT 7
- Support passing `focusOptions` to `react-focus-lock`
- Upgrade react-focus-lock to 2.9.4 HOT 1
- `gapMode` prop/API is not actually used HOT 7
- "React does not recognize the `gapMode` prop on a DOM element" warning HOT 3
- Missing Prop `noFocusGuards` HOT 6
- iOS: keyboard popping up on input focus scrolls locked body HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from react-focus-on.