Project

General

Profile

Actions

Bug #15276

closed

The editor get the focus on page load on IE

Added by Guillaume Crico over 18 years ago. Updated almost 18 years ago.

Status:
Closed
Priority:
Should have
Category:
RTE (rtehtmlarea + ckeditor)
Target version:
-
Start date:
2005-12-12
Due date:
% Done:

0%

Estimated time:
TYPO3 Version:
PHP Version:
Tags:
Complexity:
Is Regression:
Sprint Focus:

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)

Actions #1

Updated by Stanislas Rolland about 18 years ago

Will be easier to do:

if (HTMLArea.is_ie) doc.selection.empty();

just after contentEditable is set.

Actions #2

Updated by Stanislas Rolland about 18 years ago

Fixed in TYPO3core CVS, branch HEAD and in TER version 1.4.0.

Actions

Also available in: Atom PDF