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

切换输入法后光标错位 #1289

Closed
Lagrange1813 opened this issue Aug 30, 2022 · 5 comments
Closed

切换输入法后光标错位 #1289

Lagrange1813 opened this issue Aug 30, 2022 · 5 comments
Assignees
Milestone

Comments

@Lagrange1813
Copy link
Contributor

Lagrange1813 commented Aug 30, 2022

编辑模式

wysiwyg 所见即所得模式

描述问题

经过测试,在 Safari 和 iOS 的 WebView 上使用 Vditor 时,每次换新行后先输入英文再删除再插入中文,此时光标相对于最后一个预览的拼音会有一点错位。

期待的结果

修复该问题

截屏或录像

2022-08-30.13.52.13.mov

版本信息

版本:v3.8.17
操作系统:macOS 12.5
浏览器:WKWebView,Safari

其他信息

试着调试了一下,发现当按enter到新行时,页面元素如图
截屏2022-08-30 18 56 55
当在此页面切换输入法时,
截屏2022-08-30 19 03 15
输入时,
截屏2022-08-30 18 59 31
此时中文拼音并没有出现错位现象。

但如果删除英文后切换中文输入法,再输入,则会变成
截屏2022-08-30 19 05 14

与Safari不同的是,Chrome直接以zerowidthspace占位,并不会出现这种情况
截屏2022-08-30 18 58 54


发现WkWebView似乎和Safari不太一样,这个问题更严重一点,直接换行就会出现光标错位。
截屏2022-08-30 20 55 31
测试了一下,还是wysiwyg的input有点问题 🙉

@Vanessa219
Copy link
Owner

是不是浏览器渲染光标的时候有问题,更新再看看。

@axiaoxin
Copy link

ios safari上我的编辑框点击后没有任何反应,键盘都没出现,这个是需要配置什么吗?

@axiaoxin
Copy link

ios safari上我的编辑框点击后没有任何反应,键盘都没出现,这个是需要配置什么吗?

忽略,已解决。父元素用了bootstrap的user-select-all导致的

Lagrange1813 added a commit to Lagrange1813/vditor that referenced this issue Oct 15, 2022
@Vanessa219
Copy link
Owner

没有问题的话我就先关闭了。

@Vanessa219 Vanessa219 added this to the 3.8 milestone Oct 21, 2022
@Vanessa219 Vanessa219 changed the title Safari 和 iOS/macOS WebView 的输入时的光标位置问题 切换输入法后光标错位 Oct 21, 2022
@Vanessa219
Copy link
Owner

#1314

Vanessa219 pushed a commit that referenced this issue Oct 21, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants