DeisgnMode Problem in Firefox

R

Roshan Mathews

I have an IFrame in my page which I have made editable by setting
designMode="on".

When I add content to the document in the IFrame using:

t = iframedoc.createTextNode("text");
r = iframewin.getSelection().getRangeAt(0);
r.insertNode( t );

the "text" gets displayed in the iFrame, but I can't backspace or
delete it. In Firebug, I can see that the default <BR> tag has the
attributes "_moz_editor_bogus_node=TRUE" and "_moz_dirty".

Now if I add a space, (or anything else from the keyboard), the BR
tag's _moz_editor_bogus_node attribute is removed, and I can backspace
or delete the "text" added. But removing that attribute by using
node.removeAttribute() doesn't seem to enable the backspacing of the
text.

Any ideas/pointers on how I may fix this?

Thanks,
Roshan Mathews
 
P

pr

Roshan said:
I have an IFrame in my page which I have made editable by setting
designMode="on".

When I add content to the document in the IFrame using:

t = iframedoc.createTextNode("text");
r = iframewin.getSelection().getRangeAt(0);
r.insertNode( t );

the "text" gets displayed in the iFrame, but I can't backspace or
delete it.
[...]

There's a bug related to this at <URL:
https://bugzilla.mozilla.org/show_bug.cgi?id=232791>. The suggested
workaround is to turn designMode off and then on again, which works in a
quick test I did of your scenario.
 
P

pr

Roshan said:
Thank you. That worked very well. May I ask how you found this? I'd
been looking for days.

I've spent a good few hours not finding things on Bugzilla myself, so I
sympathise. This time, however, a basic search for 'designMode delete'
worked, plus a vague memory that the Mozilla editor is known as 'Midas'
(perhaps it produces golden markup).
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
474,145
Messages
2,570,824
Members
47,370
Latest member
desertedtyro29

Latest Threads

Top