Focus and Tab key


I know this is much a Javascript than CodeMirror question, but using CodeMirror as a [wiki syntax highlighter] (, I need it to alter the editor’s tab key behavior: While editing regular wiki text there’s no indentation considerations and I’m used to move the focus from/to next/prev input of the underlying editing form with the tab key as provided as usual browser’s behavior.

Thanks to the manual, I already found the way to prevent tab char into my wiki text, but now, how can I do that?


1 Like

Bind the Tab key to the value false, for example by passing an option like extraKeys: {Tab: false}. That’ll disable all handling of that key by CodeMirror.

1 Like

That’s easy.

BTW, may I also bind it to a function returning false (if I want to tweak the behavior under some circumstances) ?

Nope, that currently does not work.