Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
Clear All
new posts

    SmartClient 5.7 / 5.7.1 Patch for focus / ClickMask interaction in Internet Explorer

    This patch fixes an Internet-Explorer-only bug in SmartClient 5.7 and 5.7.1 whereby in some cases a click mask could be dismissed and fire its click action at the wrong time.
    This bug could be tripped by calling 'focus()' on some widget and then having a clickMask be shown in the same thread that would mask the widget.

    Clickmasks are typically not manipulated directly by developers, but are used internally as part of modal ListGrid editing and whenever modal Windows are shown.

    Note that this patch resolves the issue reported in this thread

    Code:
    //----------------------------------------------------------------------------
    // Isomorphic SmartClient v5.7 patch
    // Purpose: Fix for an Internet-Explorer only bug whereby focusing on a component, then showing
    // a ClickMask over that item could cause the click mask to fire it's click action and be 
    // dismissed early.
    // 
    // Applies to the SmartClient versions 5.7 and 5.71 only
    //----------------------------------------------------------------------------
    
    if (window.isc && (isc.version.startsWith("5.7/") || isc.version.startsWith("5.7.1/")) ) {
        if (isc.Browser.isIE) {
        isc.EventHandler.addClassMethods({
            _pcmf : isc.EventHandler.checkMaskedFocus,
            checkMaskedFocus : function (target) {
                var activeElement = this.getActiveElement();
                var handle = target ? target.getHandle() : null;   
                if (!handle) return;
                var focusStillInCanvas;
                while (activeElement && activeElement.tagName) {
                    if (activeElement == handle) {
                        focusStillInCanvas = true;
                        break;
                    }
                    if (activeElement.eventProxy) {
    
                        focusStillInCanvas = (activeElement.eventProxy == target.getID());
                        break;
                    }
                    activeElement = activeElement.parentElement;
                }
                if (!focusStillInCanvas) return;
        
                return this._pcmf(target);
            }
        })
        }
    
    } else {
        if (window.isc) {
            isc.Log.logWarn("Patch for SmartClient 5.7 and 5.71 included in this application. " +
                "You are currently running SmartClient verion '"+ isc.version + 
                "'. This patch is not compatible with this build and will have no effect. " +
                "It should be removed from your application source.");
        }    
    }
Working...
X