editor.js icon indicating copy to clipboard operation
editor.js copied to clipboard

I cannot use backspace to remove whitespace character at the start of a block

Open adam-drozdz-ie opened this issue 1 year ago • 0 comments

Steps to reproduce:

  1. Use API to insert a block, which starts with a whitespace - space or tab (\t).
  2. Focus right after the whitespace and try to remove it by using Backspace - you can't

Expected behavior: You should be able to remove the whitespace, just like it works for letters, numbers, special characters...

Device, Browser, OS: Chrome 118, Windows

Editor.js version: 2.28.2

Plugins you use with their versions: No plugins are used

Hello, I started using editor.js a couple of weeks ago and here's a problem I've recently stumbled upon: when you create a paragraph block, which starts with a whitespace, you cannot remove the whitespace with Backspace button. Here's a reproduction: https://codesandbox.io/s/quizzical-hooks-4nctln?file=/index.html

As you can see, I create a paragraph block with blocks.insert("paragraph", { text: "\tabc" }); and then I can't remove the tab at the beginning of the string with Backspace. I can remove it with the Delete key, but I want Backspace to work as well. Is this a known issue?

adam-drozdz-ie avatar Oct 24 '23 12:10 adam-drozdz-ie