简体   繁体   English

光标(尖号)在contenteditable div中不可见

[英]cursor (caret) is not visible in contenteditable div

When I click on a text in a contenteditable div, the cursor does not appear to move. 当我单击可编辑内容的div中的文本时,光标似乎没有移动。

once text is typed, the cursor becomes visible and text is entered in the clicked location. 键入文本后,光标变为可见,并且在单击的位置输入了文本。

its as if the cursor moves, but is not being redrawn. 就像光标移动了一样,但是没有被重绘。

I am unable to reproduce the bug in a simple jsfiddle environment. 我无法在简单的jsfiddle环境中重现该错误。

Has anyone encountered such an issue before? 有人遇到过这样的问题吗?

In the meantime I am trying to isolate the cause of the problem by removing css and javascript file references from the page. 同时,我试图通过从页面中删除css和javascript文件引用来找出问题的原因。 and reverse- starting with a blank page and adding js/css in attempt to reproduce. 然后从空白页开始反向添加js / css以尝试重现。

EDIT IN RESPONSE TO COMMENTS BELOW: 根据以下评论进行编辑:

Browser: chrome Javascript modules: jquery, jquery ui, rangy. 浏览器:Chrome浏览器的Javascript模块:jQuery的,jQuery UI的,瘦长。

I tried to remove all javascript. 我试图删除所有JavaScript。 and the bug was still there. 而且错误仍然存​​在。 It must be coming from the css. 它必须来自CSS。 I am trying to single out the css rules involved. 我试图找出涉及的CSS规则。 It appears to be a combination of things. 它似乎是事物的组合。 the :before psudo class (that I am using to show placeholder text in the div if it has no text) seems to be part of the problem. :before psudo类(如果没有文本,我将用来在div中显示占位符文本)似乎是问题的一部分。

The problem was traced to css3 3d transformations on a div that is located in the background of the contenteditable element. 该问题可追溯到位于contenteditable元素背景中的div上的css3 3d转换。

Will try to place the background element in an iframe to resolve the issue. 将尝试将背景元素放置在iframe中以解决此问题。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 将插入号/光标位置设置为可编辑div的末尾 - setting the caret/cursor position to the end of a contenteditable div 在contentEditable div中的光标(尖号)位置附加一个跨度 - append a span at the cursor(caret) location in the contentEditable div 如何在特定的contenteditable div上设置插入符/光标位置? - How do I set the caret/cursor position on a specific contenteditable div? 修改contenteditable div中的文本而不重置插入符(光标)位置 - Modify text in a contenteditable div without resetting the caret (cursor) position 隐藏在Internet Explorer中的contenteditable div上的插入符号(文本光标) - hide caret (text cursor) on contenteditable div in internet explorer 如何在 contenteditable 元素(div)中设置插入符号(光标)position? - How to set the caret (cursor) position in a contenteditable element (div)? 如何在contenteditable中跟踪插入符/光标? - How to track caret/cursor in contenteditable? 获取多个可编辑的div中的最新插入符号位置,并将图像附加到最后出现光标的div中 - Get the latest caret position among multiple contenteditable div and append image to the div where the cursor was present lastly 在contenteditable div中设置插入符位置 - Set caret position in contenteditable div 在一个可信的div中插入插入符号的html - Insert html at caret in a contenteditable div
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM