Hi Tobias,

To create a TextRange object, you can use only the body, button, and textArea 
objects and
an input object with one of the following types: button, hidden, password, 
reset, submit, or text.
The isTextEdit property can be used to avoid the exception.

You should use qx.bom.Range.get instead.

Regards,
Romeo

Von: Tost, Tobias [mailto:[email protected]]
Gesendet: Donnerstag, 23. Mai 2013 07:39
An: [email protected]
Betreff: [qooxdoo-devel] ScriptError with IE 10 in Focus.js

Hi,

recently, we came across a script-error when creating several buttons with IE10 
on Windows 8 machines where the Focus-Handler fails to call "createTextrange". 
The Project uses 2.0.1 but the code seems unchanged from 2.1.1:

try {
  // focus element before set cursor position
  element.focus();

  // Fixed cursor position issue with IE, only when nothing is selected.
  // See [BUG #3519] for details.
  var selection = qx.bom.Selection.get(element);
  if (selection.length == 0) {
    var textRange = element.createTextRange();
    textRange.moveStart('character', element.value.length);
    textRange.collapse();
    textRange.select();
  }
} catch(ex) {};

The element is obviously valid, otherwise it would have crashed at 
element.focus(). Exact message is:

Caught exception occurred : Object doesn't support property or method 
'createTextRange'

Sadly I was not able to setup a simple testcase for that - it happens during 
some large DOM-update as a forum window gets created and shown. Same code 
worked fine with IE versions before. This message gets only posted to console 
if "break on error" is enabled, otherwise the IE tab will crash.

Is there any workaround available for that or do we have to revise the whole 
flow of window creation because of that?

Thanks in advance,

Tobias

------------------------------------------------------------------------------
Try New Relic Now & We'll Send You this Cool Shirt
New Relic is the only SaaS-based application performance monitoring service 
that delivers powerful full stack analytics. Optimize and monitor your
browser, app, & servers with just a few lines of code. Try New Relic
and get this awesome Nerd Life shirt! http://p.sf.net/sfu/newrelic_d2d_may
_______________________________________________
qooxdoo-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel

Reply via email to