Midas don't let user delete text after adding text with innerHTML

RESOLVED DUPLICATE of bug 474255

Status

()

Core
Editor
--
major
RESOLVED DUPLICATE of bug 474255
15 years ago
6 years ago

People

(Reporter: dragoran, Unassigned)

Tracking

({testcase})

Trunk
x86
All
testcase
Points:
---
Bug Flags:
blocking1.8b5 -

Firefox Tracking Flags

(Not tracked)

Details

(Whiteboard: midas, URL)

Attachments

(2 attachments)

(Reporter)

Description

15 years ago
User-Agent:       
Build Identifier: Mozilla/5.0 (X11; U; Linux i686; de-DE; rv:1.5) Gecko/20031007 Firebird/0.7

i have coded a wysiwyg editor and it works fine but when i change the innerHTML
to anything (designMode is still on) the user cannot change the text until
he/she type a char. in MSIE the user don't have to type anything it just works.




Reproducible: Always
Steps to Reproduce:
if you have a iframe with a id edit (designMode='on') 
and have button like this
<input type="button"
onclick="document.getElementById('edit').contentDocument.body.innerHTML='<b>test</b>'"
value="x" />
you will see this issue

Actual Results:  
the user must type a char to be able to edit the text

Expected Results:  
the user should be able to edit the text without typing a char

Comment 1

15 years ago
Can you provide with a testcase?
(Reporter)

Comment 2

15 years ago
(In reply to comment #1)
> Can you provide with a testcase?
yes
http://dragoran.hockrad02.de/editor/editor2.html
klick test and try to edit the content...
then enter any char and try it again

Comment 3

15 years ago
I dont know exaclty whats wrong here, i press the test button, and it adds
"test", then i select the text and press bold, italic etc and it all works fine.
(Reporter)

Comment 4

15 years ago
(In reply to comment #3)
> I dont know exaclty whats wrong here, i press the test button, and it adds
> "test", then i select the text and press bold, italic etc and it all works fine.

try to delete test (using backspace)

Comment 5

15 years ago
Confirming, to reproduce:
1. Press test button to insert "test" string
2. try to delete the inserted text with backspace.
Assignee: blake → mozeditor
Status: UNCONFIRMED → NEW
Component: General → Editor: Core
Ever confirmed: true
OS: Linux → All
Product: Firebird → Browser
QA Contact: sairuh
Version: unspecified → Trunk

Updated

15 years ago
Summary: Midas don't let user delete text → Midas don't let user delete text after adding text with innerHTML
Whiteboard: midas

Updated

14 years ago
Severity: normal → major

Comment 6

13 years ago
url doesn't find the testcase anymore

Comment 7

13 years ago
Created attachment 187018 [details]
test case

Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8b2) Gecko/20050619
Firefox/1.0+

I'm activating designMode on window.onload here, since Fx 1.0.x has trouble
with designMode in iframe onload.  500ms delay before setting innerHTML ensures
plenty of time for the iframe contents to completely load.

Comment 8

13 years ago
Created attachment 187019 [details]
workaround (also partially fixes Fx 1.0.x problems with iframe onload)

The workaround consists of toggling off/on designMode after setting innerHTML:

editor.body.innerHTML = 'abc';
editor.designMode = 'off';
editor.designMode = 'on';

Interestingly, this (along with the 0-delay setTimeout and nulling onload
workarounds) toggling allows Fx 1.0.x to activate designMode on iframe onload. 
That means I don't need the 500ms delay before setting innerHTML.

Updated

13 years ago
Keywords: testcase

Comment 9

13 years ago
After some more experimentation, the designMode toggling actually isn't
necessary.  designMode just needs to be set to 'on' again:

editor.body.innerHTML = 'abc';
editor.designMode = 'on';

Also, the mentioned Fx 1.0.x iframe onload fix is the 0-time setTimeout.

Updated

13 years ago
Flags: blocking1.8b4?

Comment 10

13 years ago
I take that back.

editor.body.innerHTML = 'abc';
editor.designMode = 'off';
editor.designMode = 'on';

is necessary for the latest build.

editor.body.innerHTML = 'abc';
editor.designMode = 'on';

works for 1.0.5.

Updated

13 years ago
Flags: blocking1.8b4? → blocking1.8b4-

Comment 11

12 years ago
toggling off/on designMode after setting innerHTML still needed in Firefox 1.5 and Firefox 2.0
QA Contact: bugzilla → editor
Assignee: mozeditor → nobody
Status: NEW → RESOLVED
Last Resolved: 10 years ago
Resolution: --- → DUPLICATE
Duplicate of bug: 474255
You need to log in before you can comment on or make changes to this bug.