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
Can't delete a text node at the top of a document above a block node #484
Comments
You can do esc/ctrl-click to select the textblock, and then delete it, but I agree that's not terribly obvious. Do you have any suggestions of what might be obvious ways to do this? |
I think when a text block is empty, a forward-delete could delete the text block itself rather than the block after it. What do you think? |
But then how would people go about deleting the block node? When it's a leaf node, it is automatically selected when you arrow onto it, so that wouldn't be too hard, but if it's, for example, a table (see this issue), you'll need to be able to delete it from the outside somehow. |
Does having backspace in such a node (and, conversely, delete in an empty textblock at the bottom of the document) delete this node seem like a workable idea? It might not be the very first thing people try, but it is relatively close at hand, and that is an action that does not currently have any meaning, so it won't conflict with another piece of functionality. |
I agree. This is what I have implemented for our editor and it works really well when the empty paragraph is followed by block node types like lists, blockquotes, tables, or code blocks.
I think that for lists, blockquotes, tables, and code blocks the most obvious thing for the user to do is to select the content of the block node and to press backspace/delete. After this first step they end up with an empty block node (e.g. empty code block) and they can then press backspace again to delete the whole node. This is currently working well for lists, blockquotes, and code blocks.
I like this behavior and it works well for our use cases.
I would only have backspace delete such a node if it is completely empty as I would expect the user to first select and delete all content of the node if he wants to delete the whole node. |
Yes, of course, only when empty. |
The behavior I introduced isn't ideal either (see #498), so I've reverted it. Searching around shows that other WYSIWYG editors have a similar problem (apparently, in Google Docs, it is flat out impossible to delete a paragraph above a table). We do have node-select-and-delete as a relatively straightforward solution. If you feel that is too obscure, you can add an extra control to your app, or you can propose a specific other solution. I'm closing this until a new proposal comes up. |
If a document begins with a text node above a block node, it's hard to delete the text node.
eg. pressing forward-delete while the selection is in the text node results in the block node below being deleted. Pressing delete in the text node does nothing. Pressing delete with the block node selected deletes the block node.
Here's an awkward screen recording showing the behavior:
The text was updated successfully, but these errors were encountered: