Synthetic event warning onKeyDown
See original GitHub issueWith the latest version of the daterangepicker i get the following warnings logged if i for example click into the start date input, type something and hit cmd
+ A
.
Warning: This synthetic event is reused for performance reasons. If you're seeing this, you're accessing the method `stopPropagation` on a released/nullified synthetic event. This is a no-op function. If you must keep the original synthetic event around, use event.persist(). See https://fb.me/react-event-pooling for more information.
printWarning @ warning.js?8a56:36
warning @ warning.js?8a56:60
warn @ SyntheticEvent.js?2535:265
get @ SyntheticEvent.js?2535:259
onKeyDown @ DateInput.js?2f69:265
invokeFunc @ index.js?f580:160
trailingEdge @ index.js?f580:207
timerExpired @ index.js?f580:195
Warning: This synthetic event is reused for performance reasons. If you're seeing this, you're accessing the method `key` on a released/nullified synthetic event. This is a no-op function. If you must keep the original synthetic event around, use event.persist(). See https://fb.me/react-event-pooling for more information.
printWarning @ warning.js?8a56:36
warning @ warning.js?8a56:60
warn @ SyntheticEvent.js?2535:265
get @ SyntheticEvent.js?2535:259
onKeyDown @ DateInput.js?2f69:272
invokeFunc @ index.js?f580:160
trailingEdge @ index.js?f580:207
timerExpired @ index.js?f580:195
I notice that you’re throttling the onKeyDown
event handler, so it may be that the event is nullified by the time the handler is actually called, as described here http://stackoverflow.com/questions/35435074/using-debouncer-with-react-event. This makes sense to me as the warning is being thrown on the trailing edge of the throttle.
Issue Analytics
- State:
- Created 6 years ago
- Reactions:15
- Comments:5 (2 by maintainers)
Top Results From Across the Web
Synthetic event warning onKeyDown · Issue #514 - GitHub
I notice that you're throttling the onKeyDown event handler, so it may be that the event is nullified by the time the handler...
Read more >SyntheticEvent - React
This reference guide documents the SyntheticEvent wrapper that forms part of React's Event System. See the Handling Events guide to learn more.
Read more >Warning: This synthetic event is reused for performance ...
This is what React documentation says about it: "The SyntheticEvent is pooled. This means that the SyntheticEvent object will be reused and all ......
Read more >Getting started with React SyntheticEvent - LogRocket Blog
React SyntheticEvent is a unified cross-browser wrapper around the browser's native events that prevents browser inconsistencies.
Read more >Debouncing events with React - Medium
Warning: This synthetic event is reused for performance reasons. If you're seeing this, you're accessing the property `target` on a ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I can confirm that modifying the source and setting the
trailing
tofalse
does fix the issue. I believe this would result in onKeyDown only being called on the leading edge. Another possible solution would be wrapping the call to the throttled handler and persisting the event.Either fix would be pretty simple so i could make a PR if someone could confirm which solution seems better.
I’m not 100% sure it is related but I have the problem in 14.0.0 14.1.0 and 13.0.6 by simply pressing SHIFT+TAB to switch to the next field. I have a lot of fields on my page and I want to navigate to the next one.
Nothing special in my code, I just inserted your component today with all the default parameters of the example. I tested on Firefox 56.
[edit]: I though it was TAB but it is actually shift+tab so it’s probably more SHIFT