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

BACKSPACE and DELETE in multiline text does not behave as expected if text is empty #839

Open
digital-ember opened this issue May 10, 2024 · 4 comments
Labels

Comments

@digital-ember
Copy link

I don't quite understand the implementation for DELETE and BACKSPACE in the multiline runtime EditorCell_Word.executeTextAction() . If the caret is at the beginning (BACKSPACE) or at the end (DELETE), the action is "transfered" to the next label cell, if one exists.
I guess it makes sense for the cases where the text itself is not empty AND the next cell it trasnfers to is editable.

However, I have a case where a multiline text cell is surrounded by read-only constant cells and if the text is empty, both BACKSPACE and DELETE should allow the user to delete the containing node, or at least allow me as the language author to define what should happen.

Unfortunately, adding a action map to the multiline cell is ignored by the multiline runtime :(

@digital-ember
Copy link
Author

Keymaps also seem to be ignored ....

@digital-ember digital-ember changed the title BACKSPACE and DELETE in multiline text does not behave as expected in text is empty BACKSPACE and DELETE in multiline text does not behave as expected if text is empty May 10, 2024
@alexanderpann
Copy link
Collaborator

In your mentioned case:

  • BACKSPACE = delete character to the left of cursor -> there is no text, so jump to cell to the left and re-execute action
  • DELETE = delete character to the right of cursor -> there is no text, jump to cell to the right and re-execute action

We would need to see some other use cases if deleting the node always makes sense if the text is empty. Otherwise, we could add a style item that can influence the behavior.

@digital-ember
Copy link
Author

digital-ember commented May 13, 2024

Thanks, I understand why it behaves like it does, but I wonder how one is supposed to delete a multiline text field with the keyboard?
Notice that the surrounding cells in my case are read-only, so the behavior of navigating there does not make sense in my opinion. If there is another editable cell, like a property or reference, maybe, but even then I would argue that it would be closer to how a regular text editor behaves if in the a case of a "empty paragraph", pressing backspace / delete does not just set the cursor to the next or previous paragraph, but also removes the current one, wouldn't you agree?

@alexanderpann
Copy link
Collaborator

Yes, I agree.
As far as I can tell, this behavior was implemented for the richtext language in TextCellModifier#modifyIWordCell. The feature you want, sounds like the auto-deletable style item which we could support.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants