Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Unexpect behavior when text node with single character #49

Open
Benbinbin opened this issue Feb 1, 2025 · 0 comments
Open

Unexpect behavior when text node with single character #49

Benbinbin opened this issue Feb 1, 2025 · 0 comments

Comments

@Benbinbin
Copy link

record.mp4

because the property $pos.textOffset will be zero when the positions that point between nodes, it causes the unexpect behavior(show in the video) when text node with single character

maybe we can change the conditional as follow to tell if the position point into the first charater of the textNode and press ArrowLeft

const nodeBefore = $pos.nodeBefore;

if (event.key === 'ArrowLeft' && nodeBefore.isText && nodeBefore.nodeSize === 1) {
  // ...
}
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant