#15276The editor get the focus on page load on IE
Description
The editor get the focus on page load on IE.
It seems that the “doc.body.contentEditable = true” directive is responsible of this behavior.
My solution is to make the content editable on the first “user” focus.
/!\ NOT TESTED IN SAFARI !
Ain’t got no Mac…
This patch may have some issue with this browser.
—- C:\_gcrico\VDT\rtehtmlarea.1.0.0\htmlarea\htmlarea.js Fri Dec 09 15:34:18 2005
+++ C:\_gcrico\VDT\ext\rtehtmlarea\htmlarea\htmlarea.js Mon Dec 12 09:34:15 2005
@@ -1009,7 1009,11
// Set contents editable
if (docWellFormed) {
if (HTMLArea.is_gecko && !HTMLArea.is_safari && !this._initEditMode()) return false;
+/* begin IE no focus on load * /
if (HTMLArea.is_ie || HTMLArea.is_safari) doc.body.contentEditable = true;
+/* /
HTMLArea._appendToLog(“[HTMLArea::stylesLoaded]: Running Getronics ‘IE no focus on load’ branch.”);
+/ end IE no focus on load /
this._editMode = “wysiwyg”;
if (doc.body.contentEditable || doc.designMode "on") HTMLArea._appendToLog("[HTMLArea::initIframe]: Design mode successfully set.");
} else {
@@ -1165,7 +1169,9 @@
this._doc.open();
this._doc.write(html);
this._doc.close();
+/* begin IE no focus on load * /
this._doc.body.contentEditable = true;
+/* end IE no focus on load */
return true;
};
};
@@ -1361,6 +1367,12 @@
HTMLArea.prototype.focusEditor = function() {
switch (this._editMode) {
case "wysiwyg" :
+/* begin IE no focus on load */
+ if ((HTMLArea.is_ie || HTMLArea.is_safari) && this._doc.body.contentEditable ! ‘true’) {
+ this._doc.body.contentEditable = true;
+ HTMLArea._appendToLog(“[HTMLArea::focusEditor]: Design mode successfully set.”);
+ }
+/ end IE no focus on load */
try {
if(HTMLArea.is_safari) this._doc.focus();
else this._iframe.contentWindow.focus();
(issue imported from #M2026)
Reviews 0
No change resolves or names this issue in its commit message, and no comment links one.