Mozilla始终将游标位置在可疑范围内发送到开头

时间:2017-05-16 15:19:01

标签: html css mozilla

我遇到Mozilla 53.0.2版(32位)的问题。

当我在跨度中单击以编辑文本时,它会在开头移动光标。我试过改变属性和CSS。我发现这是以前版本中的一个错误,但我不知道它是否仍然存在问题

<td>

<span 
class="edit_notes"  
style="min-width: 1200px; display: inline-block;display:-moz-inline-box;-moz-user-select: element;" 
draggable="false" 
id="comment469"  
contenteditable="">

TEXT TO EDIT

</span>

</td>

#table1 td, tr, thead, tbody, thead, th {
    padding: 4px;
    text-align: left;
}
.table > tbody > tr > td, .table > tbody > tr > th, .table > tfoot > tr > td, .table > tfoot > tr > th, .table > thead > tr > td, .table > thead > tr > th {
    padding: 8px;
    line-height: 1.42857143;
    vertical-align: top;
    border-top: 1px solid #ddd;
}

2 个答案:

答案 0 :(得分:0)

我在Firefox中没有问题,在跨度中定位,即使是内联块 - 我怀疑你的问题是contenteditable应该=“true”或“false” - 将其设置为“”可能会被解释为false,因此你不能在这个范围内定位。

答案 1 :(得分:0)

问题解决了,

我发现它是javascript的问题。 Opera,Chrome,甚至Internet Explorer都表现得很好,但是mozilla一直在发送插入符号。在我将以下代码更改为新代码后,它运行良好。

// OLD

function clear_input(ID) {
  oldhtml = $("#comment" + ID).html().replace(/&nbsp;/g, "");
  var newhtml = oldhtml.replace(/&nbsp;/g, "");
  $("#comment" + ID).html(newhtml);
}

// NEW

function clear_input(ID) {
  $("#comment" + ID).html().replace(/&nbsp;/g, "");
}
相关问题