2013-07-18 66 views
0

我已经成功地将ACE编辑器嵌入到我的网站中,但它始终恢复为只读模式。当我第一次将光标放入编辑器时,我可以键入文本,但如果我移动鼠标并将光标放在另一个位置,我将无法再输入。当我检查编辑器的属性时,看起来只读设置为true。Ace编辑器保持恢复到只读模式

更新
看来它可能没有与只读(只有它表现出相同的行为)做。我注意到,当我将光标放到编辑器中时,它接受我输入的文本。当我将光标设置到另一个位置时,textarea位置被更新,然后从任何文本中输入结果为“叮”声,就像你不能在这里键入声音类型一样。这就像一个Windows警报消息。

反正我设置的div容器到不同的显示或位置类型之一,那么突然的一切运作正常,但随后的编辑是在错误的位置。

如果我点击编辑器外面,然后返回到编辑器,然后我可以再次键入......至少,直到我将光标移动就像我前面所描述。

这里之前(工作):

<div style="position: absolute; background-color: rgb(255, 255, 255); border: 0px none; overflow: auto; display: block; left: 316px; top: 239px; width: 1074px; height: 140px;" id="editor0"><div id="iframe_editor0" frameborder="0"><div class=" ace_editor ace_nobold ace-crimson-editor" id="editor" style="display:block;position:absolute;top:0px;left:0px;right:0px;bottom:0px;height:100%;"><textarea style="bottom: 92px; height: 16px; width: 7.2px; right: 1019.6px;" spellcheck="false" wrap="off" class="ace_text-input"></textarea><div style="display: none;" class="ace_gutter"><div style="margin-top: 0px; height: 172px; width: 34px;" class="ace_layer ace_gutter-layer"><div class="ace_gutter-cell " style="height:16px;">1</div><div class="ace_gutter-cell " style="height:16px;">2</div><div class="ace_gutter-cell " style="height:16px;">3</div><div class="ace_gutter-cell " style="height:16px;">4</div></div><div style="top: 32px; height: 16px;" class="ace_gutter-active-line"></div></div><div style="left: 0px; right: 15px;" class="ace_scroller"><div style="margin-top: 0px; width: 1066px; height: 172px;" class="ace_content"><div class="ace_layer ace_print-margin-layer"><div style="left: 580px; visibility: hidden;" class="ace_print-margin"></div></div><div class="ace_layer ace_marker-layer"><div class="ace_active-line" style="height:16px;top:32px;left:0;right:0;"></div></div><div style="padding: 0px 4px;" class="ace_layer ace_text-layer"><div class="ace_line" style="height:16px"><span class="ace_meta ace_tag">&lt;</span><span class="ace_meta ace_tag ace_tag-name">div</span>&nbsp;<span class="ace_entity ace_other ace_attribute-name">style</span><span class="ace_keyword ace_operator">=</span><span class="ace_string">"position:relative;width:640px;height:500px;font-family:Arial;font-size:12px;margin:0&nbsp;auto;left:8px;top:14px;background-color:#FFFFFF;"</span><span class="ace_meta ace_tag ace_r">&gt;</span></div><div class="ace_line" style="height:16px"></div><div class="ace_line" style="height:16px"><span class="ace_meta ace_tag">&lt;/</span><span class="ace_meta ace_tag ace_tag-name">div</span><span class="ace_meta ace_tag ace_r">&gt;</span></div><div class="ace_line" style="height:16px"></div></div><div class="ace_layer ace_marker-layer"></div><div class="ace_layer ace_cursor-layer ace_hidden-cursors"><div style="left: 47.2px; top: 32px; width: 7.2px; height: 16px;" class="ace_cursor"></div></div></div></div><div style="height: auto; width: auto; top: -100px; left: -100px; visibility: hidden; position: fixed; overflow: visible; white-space: nowrap;">X</div><div style="width: 20px; height: 140px;" class="ace_scrollbar"><div style="height: 64px;" class="ace_scrollbar-inner"></div></div></div></div></div> 

而经过重新定位光标/鼠标点击在新位置(不工作):

<div style="position: absolute; background-color: rgb(255, 255, 255); border: 0px none; overflow: auto; display: block; left: 316px; top: 239px; width: 1074px; height: 140px;" id="editor0"><div id="iframe_editor0" frameborder="0"><div class=" ace_editor ace_nobold ace-crimson-editor ace_focus" id="editor" style="display:block;position:absolute;top:0px;left:0px;right:0px;bottom:0px;height:100%;"><textarea style="bottom: 92px; height: 16px; width: 7.2px; right: 1019.6px;" spellcheck="false" wrap="off" class="ace_text-input"></textarea><div style="display: none;" class="ace_gutter"><div style="margin-top: 0px; height: 172px; width: 34px;" class="ace_layer ace_gutter-layer"><div class="ace_gutter-cell " style="height:16px;">1</div><div class="ace_gutter-cell " style="height:16px;">2</div><div class="ace_gutter-cell " style="height:16px;">3</div><div class="ace_gutter-cell " style="height:16px;">4</div></div><div style="top: 32px; height: 16px;" class="ace_gutter-active-line"></div></div><div style="left: 0px; right: 15px; overflow-x: hidden;" class="ace_scroller"><div style="margin-top: 0px; width: 1066px; height: 172px;" class="ace_content"><div class="ace_layer ace_print-margin-layer"><div style="left: 580px; visibility: hidden;" class="ace_print-margin"></div></div><div class="ace_layer ace_marker-layer"><div class="ace_active-line" style="height:16px;top:32px;left:0;right:0;"></div></div><div style="padding: 0px 4px;" class="ace_layer ace_text-layer"><div class="ace_line" style="height:16px"><span class="ace_meta ace_tag">&lt;</span><span class="ace_meta ace_tag ace_tag-name">div</span>&nbsp;<span class="ace_entity ace_other ace_attribute-name">style</span><span class="ace_keyword ace_operator">=</span><span class="ace_string">"position:relative;width:640px;height:500px;font-family:Arial;font-size:12px;margin:0&nbsp;auto;left:8px;top:14px;background-color:#FFFFFF;"</span><span class="ace_meta ace_tag ace_r">&gt;</span></div><div class="ace_line" style="height:16px"></div><div class="ace_line" style="height:16px"><span class="ace_meta ace_tag">&lt;/</span><span class="ace_meta ace_tag ace_tag-name">div</span><span class="ace_meta ace_tag ace_r">&gt;</span></div><div class="ace_line" style="height:16px"></div></div><div class="ace_layer ace_marker-layer"></div><div class="ace_layer ace_cursor-layer"><div style="left: 47.2px; top: 32px; width: 7.2px; height: 16px; opacity: 0;" class="ace_cursor"></div></div></div></div><div style="height: auto; width: auto; top: -100px; left: -100px; visibility: hidden; position: fixed; overflow: visible; white-space: nowrap;">X</div><div style="width: 20px; height: 140px;" class="ace_scrollbar"><div style="height: 64px;" class="ace_scrollbar-inner"></div></div></div></div></div> 

前面的代码里面是什么身体标签。

更新2
看来,如果编辑器是一个Flash/Flex应用程序的顶部是造成问题的原因。我将Flash/Flex应用程序设置为高度的一半,并且Flash应用程序下方的区域无法正常工作。同样,这只在Firefox Mac中发生。在Mac上的Safari它正常工作。

回答

0

问题发生用任何文本区域,没有明确的王牌编辑器中使用的文本区域。

如果你把一个HTML文本区域在任何Flash应用程序,键入一些文本插入HTML文本区域,然后单击文本框的另一个位置(移动光标),它表现出相同的行为。这种行为是不会输入附加文字并发出哔哔声。

的Flash Player或较新版本的Firefox的新版本已经解决了这一问题。我不知道它固定在哪个版本,但它是在2015年9月27日左右。