text selection blink when cursor move over the inline-block #1554
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
text selection blink when cursor from the paragraph begin to text, after add
Decoration.widgetzero-width space between cursor andinline-blocknode.https://github.com/user-attachments/assets/a0bedc37-1e26-40dd-b878-f1928312745a
it only happens on the structure:
| <node><text>
other stituations are not:
| <node><node><text>
<text><node> |
<node>| <node>
Which browser does this happen in? How are you selecting? Shift-arrow? Mouse? Can you set up a small script that reproduces this, because I don't see it happen when I try to do what you are describing.
@marijnh Hello, I'm using the mouse to select from the left side of the inline block, using chrome 142.0.7444.176
Here is the minimal demo:
@marijnh it can re-produce on macos chrome 142
demo page: https://4z4y.top/pm/bk-sel/
zero-width space code in here
The issue appears to be that Chrome puts the start of the selection inside the widget (since it's the only text near the cursor), and then refuses to create a selection that starts in an uneditable node and ends in editable content. You can set a
raw: trueproperty on your widget config (next torelaxedSide: true) to leave the widget editable and sidestep this issue.(I'd also recommend you either add a
keyto the widget config or make sure your widget drawing function is created only once and reused, or ProseMirror will keep redrawing the widget because it cannot tell that it's the same widget.)set
raw: truewill break default edit behavior if input text from the position. i think i can't solve it. :(@marijnh very thanks, and need more help.
if set
raw: true, text input behavior is incorrect and the text disappears after cursor leaving.https://github.com/user-attachments/assets/5b8ee490-affb-440b-82bc-57afc3d1b8dd
after input text the dom like this:
it's the same behavior if not
spanwrapped.Oh indeed, that is annoying. Can you say a bit more about what this widget is trying to do? If you're just trying to create a barrier between the cursor and the node after, maybe try an
<img>element withoutsrc, those are also invisible and treated like text, but don't have the issue that if you make them editable the cursor can go inside of them.i try to fix cursor size by adding zwsp between cursor and inline-block element. but many attempts failed.
Windows Chorme 144.0.7559.59 also happend this issue!
Here is more infomation maybe you can use:
**when you let mouse focus at the right of the IMG and select to go left, it's OK, that mean this issue only happend when you select image from left to right, not right to left. **