Quantcast
Channel: SmartClient Forums
Viewing all articles
Browse latest Browse all 4756

JS Error in IE11 with IE9 compatibility mode

$
0
0
Hi, we have a particular window that should load in IE9 compatibility mode, and it seems that by a corner case that I have not been able to reproduce with "plain" sources, a JS error is raised while trying to render the form.

I am with 10.0d and the problem is in FormItem.js here:

Code:

            if (this._IESelectionStuck()) {
                document.selection.clear();

The problem is that looking at the _IESelectionStuck function

Code:

    _IESelectionStuck : function () {
        if (!isc.Browser.isIE) return false;
        try {
            var typeDetail = document.selection ? document.selection.typeDetail : null;
        } catch (e) {
            this.logDebug("Internet explorer native 'stuck focus' state detected");
            return true;
        }
        return false;
    },

if there is a problem trying to identify "document.selection", the code goes through the catch, that returns "true", so later the "this._IESelectionStuck()" condition is "true", and then the "document.selection" fails, as it's logic.

I don't understand very well the purpose of this check, but changing the code by setting it as just as

Code:

            if (this._IESelectionStuck() && document.selection) {
                document.selection.clear();

fixes the problem.

I would appreciate if you could include it in your sources.

Thank you very much

Viewing all articles
Browse latest Browse all 4756

Trending Articles