We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Typing Shift+Tab should remove one set of spaces inserted by typing Tab. It currently continues to insert spaces rather than remove them.
In the mean time, it could least do what backspace currently does (i.e. remove all the spaces inserted by typing Tab).
The text was updated successfully, but these errors were encountered:
To support deleting tabs, I had to adapt my onTab handler to:
onTab
handleTab(evt) { let newState; let { editorState } = this.state; if (evt.shiftKey) { // since backspace removes tabs in CodeUtils // https://github.com/SamyPesse/draft-js-code/blob/9783c0f6bbedda6b7089712f9c657a72fdae636d/lib/handleKeyCommand.js#L11 newState = CodeUtils.handleKeyCommand(editorState, 'backspace'); } else { // let CodeUtils insert tabs newState = CodeUtils.handleTab(evt, editorState); } this.setState({ editorState: newState, }); }
This logic feels like it should live in CodeUtils.handleTab. Thoughts?
CodeUtils.handleTab
Sorry, something went wrong.
Yep, this looks perfect! Mind submitting a PR? Thank you!
No branches or pull requests
Typing Shift+Tab should remove one set of spaces inserted by typing Tab. It currently continues to insert spaces rather than remove them.
In the mean time, it could least do what backspace currently does (i.e. remove all the spaces inserted by typing Tab).
The text was updated successfully, but these errors were encountered: