Theocacao
Leopard
Design Element
Comment on "ContentEditable / DesignMode in FireFox"
by Phil Glanville — Sep 05
The reason for using an IFRAME is so that the selection can be stored while the user selects elsewhere outside of the IFRAME.

For example, if your editing involves selecting a drop-down or inputting a font name in a text box - in IE (and I'm guessing Safari) there is no support for having multiple (visible) active and de-active selections at the same time.

And so, the text (in your editing area) looses selection as and when the selected text box or drop-select gains focus or selection itself. (in IE you can remember the selection objects but this doesn't look so great and is unnerving for your user as it appears that the selection disappears even tho you can still use it as if it were there).

In FireFox, the selected text remains selected and the recently clicked control still works as expected, because the editing selection is in a separate frame that has it's own selection handling.

True, if you want to make certain area's quickly and freely editable on your site... not quite sure why you want to, but then this isn't very useful. If however you are using this as an extended textarea, for non-HTML users on a forum for example; or making a WYSIWYG editor - then the IFRAME method works very well, and also gives more allowances for when coding cross-browser as it keeps your editor separate from your GUI.

Hope that helps someone - took me a little while to work out the idiosyncrasies in the separate browsers where designMode was concerned, and above is one of them.. :)


Q u e s t i o n
---

I have no way of testing designMode in Safari so i was just wondering if anyone knows if it behaves in much the same way as Internet Explorer does (in the way it edits text and the javascript code used to control it).

I have successfully managed to tame IE's contentEditable behaviour (by use of events) so that it behaves more like a text editor (and that of FireFox's designMode - one example is that rather than creating paragraphs and divs on the pressing of enter it just drops to a newline) but just wandering if there are any large differences i should be watching out / ready for as i am having to extend my WYSIWYG editor to handle Apple Machines with OS X for a client.

Cheers.
Back to "ContentEditable / DesignMode in FireFox"
Design Element

Copyright © Scott Stevenson 2004-2015