Skip to content
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

Pressing Delete with a multi-block selection spanning from a paragraph doesn't delete #3191

Closed
2 tasks done
ephox-mogran opened this issue Oct 26, 2017 · 4 comments · Fixed by #3253
Closed
2 tasks done
Labels
[Feature] Writing Flow Block selection, navigation, splitting, merging, deletion...

Comments

@ephox-mogran
Copy link
Contributor

ephox-mogran commented Oct 26, 2017

Issue Overview

When a multi-selection spans from a paragraph block, pressing <del> or <backspace> does not delete the selected blocks.

Steps to Reproduce (for bugs)

  1. Create multiple paragraph blocks.
  2. Select from the text of one paragraph down to the last paragraph
  3. Press Delete

Browser: Chrome

Expected Behavior

All the selected blocks will be deleted.

Current Behavior

There are two behaviours:

a) if you selected some text in the first block, then that text is just deleted
b) if you hadn't selected any text in the first block (so you started dragging from past the last word), then it triggers a merge operation with the next block so it looks like some deletion has occurred, but not the deletion that you wanted.

Possible Solution

It's caused by the fact that Delete / Backspace is being handled by the editor (either deleting text or firing merge). I'm going to try and make the editor in read-only mode whenever a multi-selection has occurred and see what that looks like. That may or may not be a solution.

Related Issues and/or PRs

Todos

  • Tests
  • Documentation
@mcsf mcsf added the [Feature] Writing Flow Block selection, navigation, splitting, merging, deletion... label Oct 26, 2017
@ephox-mogran
Copy link
Contributor Author

Another approach will be to focus the outer container and remove selection from the window.

@ephox-mogran
Copy link
Contributor Author

So stopping focus going through to the block itself (passing null) when there is a multi-selection works fairly well, but after deleting the blocks, there is no block focused. Investigating how to resolve that.

@mcsf
Copy link
Contributor

mcsf commented Oct 27, 2017

This also affects blocks like Heading, but the fix attached covers all cases. 👌

@ellatrix
Copy link
Member

This was last fixed in #2934 I believe, after it had been broken for a while. Would be great to know what broke it again.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Feature] Writing Flow Block selection, navigation, splitting, merging, deletion...
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants