prosemirror: Can't select an atom node in Chrome if it's the last in a line
Issue details
If we render a <span>
as an atom node and it appears at the end of a line, selection doesn’t work.
Steps to reproduce
Go to https://unequaled-truthful-condition.glitch.me/, try to select from the right to left in the second line, or from left to right. The atom node won’t be selected.
Code is available at https://glitch.com/edit/#!/unequaled-truthful-condition
ProseMirror version
Latest version.
Affected platforms
Tested on Chrome, Firefox and Safari and it only happens on Chrome. Unfortunately Chrome is also the most popular browser so the user impact is pretty large.
- Chrome
- Firefox
- Internet Explorer
- Other
Screenshots / Screencast (Optional)
About this issue
- Original URL
- State: closed
- Created 3 years ago
- Reactions: 2
- Comments: 20 (7 by maintainers)
Commits related to this issue
- Use an IMG instead of BR nodes for the trailing node hack after a widget in Chrome To avoid flaky drag selection issues. FIX: Improve drag selection on Chrome when a textblock ends in an uneditable ... — committed to ProseMirror/prosemirror-view by marijnh 3 years ago
- Remove effect of patch f93aa0b0b796031329 It has problematic side effects. Issue https://github.com/ProseMirror/prosemirror/issues/1152 — committed to ProseMirror/prosemirror-view by marijnh 3 years ago
- Also enable trailing IMG hack for Chrome Issue https://github.com/ProseMirror/prosemirror/issues/1152 — committed to ProseMirror/prosemirror-view by marijnh 3 years ago
- Delay DOM selection syncing during pointer drag FIX: Avoid some bugs around drag-selecting by delaying synchronization between the DOM and the state selection until the end of the drag. Issue https:... — committed to ProseMirror/prosemirror-view by marijnh 3 years ago
I’m seeing this is still happening on Chrome, I have found that setting
visibility: hidden;
on the IMG -> with class name ProseMirror-separator fixes it but breaks on Safari(it breaks the cursor position when the user clicks the input, it goes always to start no matter the number of chars plus the last node, the selection works). Any thoughts about what could be done?Great. I’ve released the changes as 1.19.2