draft-js-markdown-shortcuts-plugin icon indicating copy to clipboard operation
draft-js-markdown-shortcuts-plugin copied to clipboard

keyBindingFn not triggering on tab key press

Open erikmartinjordan opened this issue 4 years ago • 0 comments

Inlcuding the draft-js-markdown-shortcuts-plugin is blocking key binding for the tab key.

Example:

const keyDown = (e) => {
    
    if(e.key === 'Tab'){
        
        console.log('I never get here...');
        
    }

    console.log('Other keys are working fine.');
    
}

<Editor
    editorState  = {editorState}
    onChange     = {setEditorState}
    keyBindingFn = {keyDown}
    plugins      = {plugins}
/>

If I remove the plugin, everything works as exepected and I'm able to catch tab key presses. I've tried adding onTabmethod to the Editor and works fine, but I get a warning since the method is deprecated.

It's possible to catch tab presses using KeyBindingFn?

erikmartinjordan avatar Oct 23 '20 08:10 erikmartinjordan