react-keydown icon indicating copy to clipboard operation
react-keydown copied to clipboard

How can "forceConsider" be set to true?

Open valp124 opened this issue 8 years ago • 5 comments

I need to set forceConsider argument to _onKeyDown function in event_handler.js to true. How can this be done?

The reason I need that is that I need to be able to cancel an action with an escape key, regardless of where the target is. In my case, the target sometimes falls into the black list of _shouldConsider function, and then my code doesn't work.

Thanks a lot.

valp124 avatar Sep 22 '17 19:09 valp124

@valp124 Are you wanting key bindings to work while a form element is focused?

glortho avatar Sep 23 '17 19:09 glortho

@glortho Not a form element per se -- because there is no form -- but in practice is happens to be textarea in this case.

I work in a complex single page app environment (https://www.os-js.org/) and don't always control what is in focus, the "os" is managing virtual windows, desktop icons, etc. The upshot of all this is: I want to be able to force the escape key action regardless of what appears to be the target.

valp124 avatar Sep 25 '17 12:09 valp124

Okay @valp124 do you think a global keybinding along these lines would help? https://github.com/glortho/react-keydown/issues/69

glortho avatar Sep 26 '17 23:09 glortho

If I understand #69 correctly, it should. I suppose that's the effect I would achieve if I could set forceConsider to true.

valp124 avatar Sep 27 '17 20:09 valp124

Ok @valp124 stay tuned for that. I'm hoping to work with @sheldonrong to get that merged next week.

glortho avatar Sep 28 '17 14:09 glortho