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

关于行内代码块退出时光标的定位问题 #420

Open
dhx291 opened this issue Jan 25, 2025 · 0 comments
Open

关于行内代码块退出时光标的定位问题 #420

dhx291 opened this issue Jan 25, 2025 · 0 comments

Comments

@dhx291
Copy link

dhx291 commented Jan 25, 2025

  • 当光标位于行内代码块的最后一个字符后面时,再按下右方向键,光标应该移动到 “t” 字母的前面、代码块的后面才符合习惯,但是似乎是由于浏览器的一些默认行为,导致光标会定位到 “t” 字母的后面,如图:

Image
同理,当光标位于代码块的最左边的时候,也有类似的问题:
Image

  • 问题复现方式:输入一段文字 -> 选中某一部分文字 -> 将其设置成行内代码 -> 移动光标

我看了下语雀编辑器的解决方案,似乎是在特定位置插入两个零宽字符实现“占位”,使得在光标多移动一个位置的情况下,最终也能停留到我们预期的位置上:
Image
不知道在tiptap上能否实现类似的效果?或者是否有其他解决方式?

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

No branches or pull requests

1 participant