-
-
Notifications
You must be signed in to change notification settings - Fork 2k
New issue
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
Bug with inputs #920
Comments
I encounted same problem too! editor-js/image uses div for caption input. So, I think this bug can be avoided to use <div contenteditable="true"> ! |
I confirm this bug, there is my video of it in my plugin - https://youtu.be/A1-C6L4-tkw . |
Try input.addEventListener('keydown', event => {
if (event.keyCode === 13) event.stopPropagation();
}) Create a block after pressing enter: input.addEventListener('keydown', event => {
if (event.keyCode !== 13) return;
event.stopPropagation();
this.api.blocks.insert('paragraph');
this.api.caret.setToBlock(this.api.blocks.getCurrentBlockIndex());
this.api.toolbar.open();
}) |
I am still seeing this bug in v2.22.2. I am creating a multiline MUI input via a custom plugin. The plugin renders a target Any time I hit enter within the MUI multiline text area, I get a new block. I have tried listening for Any thoughts on how I might keep focus within the |
Hi there! I created my own block tool for Editor. In my tool you have to input some text, then click "save" button, then it will render. So everything is ok, besides input. When I press Enter on the keyboard when input is focused - it creates a new block with this input. Maybe it's my bad, maybe its a bug in Editor. I have the same issues with every input in my custom block tools. Here is the video https://recordit.co/bvGKcGuRav
The text was updated successfully, but these errors were encountered: