Codemirror光标位置偏移 [英] Codemirror cursor position offset

查看:214
本文介绍了Codemirror光标位置偏移的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用代码镜像在网页中显示,突出显示和编辑xml,但是我遇到了光标位置偏离插入位置的问题,因此,如果您删除闪烁的光标所在的字符,一个您期望的字符之前的字符将被删除。我假设它与当前页面发生了CSS冲突,因为它在我的页面之外运行良好,但是在任何地方都找不到冲突。有没有人遇到过类似的问题或知道该怎么办?

I'm using code mirror to display, highlight and edit xml in a web page but I am having a problem with the cursor position being offset from the insert position so that if you delete a character from where the blinking cursor is, a character before the one you would expect gets deleted instead. I am assuming its a css clash with my current page because it works well outside my page, but cant find the clash anywhere. Has anyone had similar issues or know what to do?

推荐答案

进一步的调查显示,该页面在嵌入其中的所有div上都设置了填充造成问题的字段集。

Further investigation shows that the page had padding set on all divs embedded in fieldsets which was the cause of the problem.

这篇关于Codemirror光标位置偏移的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆