Sorry, you'll need the updated fiddle: http://jsfiddle.net/wJhJQ/1/

On 12/07/10 09:22, Barry van Oudtshoorn wrote:
 Hi,

I posted this on the MooEditable mailing list, but there was no response, so I thought I'd try my luck here. :)

Fiddle here: http://jsfiddle.net/wJhJQ/

I'm attempting to insert content into a MooEditable-ified textarea dynamically, in response to a user's actions. (It's from a symbol dialog that I wrote before the official one came around, with a few bespoke features for the app I'm working on.) Everything works fantastically in IE8 and Fx, but in IE7, the content is always inserted at the beginning of the text

My working hypothesis is that IE7 isn't preserving the selection information when the editor loses focus, but I'm having trouble ascertaining whether or not that is, in fact, the case. In the 'command' handler for my custom action, I've tried temporarily storing the range and using setRange() before the content is inserted, but this doesn't seem to work either: it looks like when you focus() the editor (as getRange() does), IE pushes the cursor to the beginning.

In the fiddle, try putting your cursor at the end of the text, then click the button. In Fx and IE8, despite losing focus, the content is inserted at the right spot. In IE7, it's not.

Any thoughts on how I can work around this problem? The users are getting antsy about it. Unfortunately, because the software is written for schools, there's the inevitable problem of IT guys not wanting to upgrade the browsers, so I can't just shrug it off. Happily, though, IE7 is our lowest supported browser: IE6 is out! :)



--
Barry van Oudtshoorn
www.barryvan.com.au

Not sent from my Apple πPhone.

Reply via email to