Undo after deleting content on Android can sporadically trick ProseMirror into thinking selection is collapsed when it's not #1393

Open
opened 2023-07-01 23:53:22 +02:00 by Nantris · 2 comments
Nantris commented 2023-07-01 23:53:22 +02:00 (Migrated from github.com)

In the image below you can see that the selection is believed to be collapsed on the ProseMirror side, but the UI and the window-selection both properly reflect the expanded selection. Please ignore the text in the images, it's irrelevant.

To reproduce this, delete some content in an expanded selection on Android in Chrome, then undo. Repeat these steps until the issue occurs. Sometimes you may need to re-select the content and try again for this to trigger.

Unknowns:

  • It may need to be nested list content but I don't believe that to be the case right now.
  • It may be necessary for the $anchor to be before the $head

Android version: 13
Android keyboard: GBoard
Browser: Chrome

image
image

In the image below you can see that the selection is believed to be collapsed on the ProseMirror side, but the UI and the `window`-selection both properly reflect the expanded selection. Please ignore the text in the images, it's irrelevant. To reproduce this, delete some content in an expanded selection on Android in Chrome, then undo. Repeat these steps until the issue occurs. Sometimes you may need to re-select the content and try again for this to trigger. **Unknowns:** - _It may need to be nested list content but I don't believe that to be the case right now._ - It may be necessary for the $anchor to be before the $head Android version: 13 Android keyboard: GBoard Browser: Chrome ![image](https://github.com/ProseMirror/prosemirror/assets/6835891/cc24335a-4ebe-43e8-a3bd-73ce8231ab81) ![image](https://github.com/ProseMirror/prosemirror/assets/6835891/31b37e87-1b65-453e-87e4-a651383323ac)
Nantris commented 2023-07-02 00:18:21 +02:00 (Migrated from github.com)

This may be because after undo Android seems to set the selection's startContainer to the parent p node, rather than inside of it in the #text node.

image

This may be because after undo Android seems to set the selection's `startContainer` to the parent `p` node, rather than inside of it in the `#text` node. ![image](https://github.com/ProseMirror/prosemirror/assets/6835891/a6b74ff1-1958-45ec-ad39-10d9d0a1bde9)
Nantris commented 2023-08-08 21:15:40 +02:00 (Migrated from github.com)

Friendly bump.

Friendly bump.
Sign in to join this conversation.
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
prosemirror/prosemirror#1393
No description provided.