question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

different table behavior when erasing text via backspace

See original GitHub issue

steps to reproduce:

  1. open https://summernote.org/
  2. create table 2x2
  3. type any string, make new line with enter, type in different string
  4. press backspace to remove everything entered
  5. in FF and Chrome you will remove the text but with different outcome.

in Chrome the caret will remove all text but this markup <p><br></p> will stay in the cell which can’t be removed with backspace or delete or in any other way. image

in FF there will also stay <br> tag but without the <p> tag. image

What is your Operating System, Browser and Version and Summernote Version you are using:

  1. Operating System: [x] Microsoft Windows [ ] Apple [ ] Linux [ ] All

  2. Browser and Version: [ ] Brave [x] Chrome Version 92.0.4515.131 (Official Build) (64-bit) [ ] Edge [x] Firefox 91 x64 [ ] Internet Explorer [ ] Opera [ ] Safari [ ] Other (Specify):

  3. Summernote Version, place an x inside the brackets: [ ] BS3 [ ] BS4 [ ] Lite [x] All

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:11 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
1der1commented, Sep 27, 2021

Great, Dennis. In a version without emptyPara you can even replace if (rng.isCollapsed() && rng.isOnCell()) { with if (rng.isCollapsed() /* && rng.isOnCell() */) { This would allow you to empty the whole editor.

1reaction
DiemenDesigncommented, Sep 27, 2021

It’s ok, I found where to put it, I had to change the function slightly, as what you see in the built package, is different in typescript namely the function name and assigning the vars, but it looks like it works.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Backspace and Delete functions back to front when editing ...
I select the cells/table I wish to clear and press "backspace" to clear the text as essentially that's what I'm doing, 'backspacing' the...
Read more >
Style Changes When "Backspace" Joins Two Separate ...
When you join two paragraphs by pressing Backspace, Word deletes the paragraph mark that separates the paragraphs and then applies the style of...
Read more >
The Linux keyboard and console HOWTO
The Motif spec says that Backspace is supposed to delete the previous character and Delete is supposed to delete the following character. Linux...
Read more >
Microsoft Word deletes a space along with the ... - Super User
Microsoft Word deletes a space along with the word when pressing Ctrl+Backspace. How do I prevent it from removing the space? · Use...
Read more >
Why is there a difference in text length with backspace or ...
Delete is character code 127 in the ASCII-Table. The delete char is written into the textinput and therefore counts to the length of...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found