Up/Down Arrow Keys Not Working on mention-plugin after altering key bindings.
See original GitHub issueHi all, I’m quite new to Draft JS /Draft JS Plugins and been trying to figure out what’s causing this. Originally what I wanted to happen is to alter the key-bindings of the editor to make the “Enter” key return a custom “submit-comment” event then assign Shift+Enter key to return a ‘split-block’ of which creates a new line or block. I was able to pull through with this code:
const handkekeyBindings = (e: SyntheticKeyboardEvent) => {
if (e.key === "Enter") {
if (e.nativeEvent.shiftKey) {
return "split-block";
} else {
return "submit-comment";
}
}
return getDefaultKeyBinding(e);
};
I applied the key-bindings handler to my Editor Component:
<Editor
editorState={editorState}
onChange={handleEditorStateChange}
keyBindingFn={handkekeyBindings}
handleKeyCommand={handleKeyEvent}
plugins={plugins}
/>
However, after altering the key-bindings of the editor , I can’t seem to use the UP/DOWN Arrow keys anymore to select any of the suggestions that would pop-out on the mentions.
Any Ideas on this one? I may perhaps messed up on something. Thanks!
Issue Analytics
- State:
- Created 3 years ago
- Reactions:2
- Comments:6
Top Results From Across the Web
draft-js-mention-plugins: mentionSuggestions is handling up ...
Use-case/Problem This was initially reported in #856. I'm running the current master of this repo and still running into this issue.
Read more >up key not working and down arrow key scrolling on its own
Go to settings > update and security > troubleshoot > additional troubleshooters > keyboard > run troubleshooter. Restart the computer and see ...
Read more >Up, Down, Left and Right arrow keys do not trigger KeyDown ...
I set KeyPreview to true and I am handling the KeyDown event on this form. My problem is that sometimes the arrow key...
Read more >3 Ways to Fix the Arrow Keys Not Working in Excel - MakeUseOf
With this guide, we'll show you how to fix arrow keys not working in Excel. ... Look out for a light on your...
Read more >WASD and arrow keys swapped? Here's how to fix it
1. If you can, unplug your keyboard and plug it back in again, preferably into a different port. This is a quick fix...
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
Found a workaround for this exact issue I was having. The idea is to remove bindings while the suggestions popup is open and apply it again when closed.
Hope this helps your use case too!
Hello. I need to popup a modal when clicking a selected mention. Would you please help me? Thanks