Firefox 3.03 and contentEditable

I use the contentEditable attribute for a DIV element in Firefox 3.03. Setting it to true allows me to edit the text content of the DIV as expected.

Then, when I set contentEditable to “false”, the div is no longer editable, as expected.

However, the flashing carriage (text input cursor) remains visible even if the text is no longer being edited. Now, the carriage is also displayed when I click on most other texts on the same page, even in normal text paragraphs.

Has anyone seen this before? Is there a way to make the carriage hide?

(When I either resize the browser, or click in another application, and return, the carriage magically disappears.)

+3
source share
3

, , contentEditable:

if ($.browser.mozilla) { // replace with browser detection of your choice
  window.getSelection().removeAllRanges();
}

"contenteditable" , IE, , false:

if ($.browser.msie) {
  element.contentEditable = false;
}
else {
  $(element).removeAttr( 'contenteditable' );
}

contentEditable , , . , , .

+6

-moz-user-input Firefox, contenteditable=false.
, . :

none     : The element does not respond to user input.
enabled  : The element can accepts user input. This is default.
disabled : The element does not accept user input.

:

// to disallow users to enter input
<asp:TextBox ID="uxFromDate" runat="server" style="-moz-user-input: disabled;"></asp:TextBox>

// to allow users to enter input
<asp:TextBox ID="uxFromDate" runat="server" style="-moz-user-input: enabled ;"></asp:TextBox>

. https://developer.mozilla.org/en/CSS/-moz-user-input.

0

ploblem, , firefox : P

 getDoc().designMode  = "off";
0

Source: https://habr.com/ru/post/1698432/


All Articles