ICEfaces
  1. ICEfaces
  2. ICE-5509

Draggable popup becomes attached to cursor in IE

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 1.8.2-EE-GA
    • Fix Version/s: 1.8.3, 1.8.2-EE-GA_P02
    • Component/s: ICE-Components
    • Labels:
      None
    • Environment:
      IE7

      Description

      Using the component showcase and IE7, drag the panelPopup upwards towards the top of IE7 so that the cursor leaves the viewing area. Release the mouse and return back to the main page area and notice that the popup is now stuck to the cursor. You need to re-click the popup in order for this to stop.

        Activity

        Hide
        Joanne Bai added a comment -

        Yip, I cannot reproduce using your application (tried IE6,7,8). What is your Tomcat 6 version? Thanks.

        Show
        Joanne Bai added a comment - Yip, I cannot reproduce using your application (tried IE6,7,8). What is your Tomcat 6 version? Thanks.
        Hide
        yip.ng added a comment -

        C:\apache-tomcat-6.0.16

        Show
        yip.ng added a comment - C:\apache-tomcat-6.0.16
        Hide
        Joanne Bai added a comment -

        Sorry, Yip. I used the wrong 1.8.2-ee branch to verify.

        Verified successfully on icefaces-ee-1.8.2_p01 revision 21058 using component showcase jsp and facelets-enh
        Verified on IE6,7,8 + Tomcat 6.0.26

        Show
        Joanne Bai added a comment - Sorry, Yip. I used the wrong 1.8.2-ee branch to verify. Verified successfully on icefaces-ee-1.8.2_p01 revision 21058 using component showcase jsp and facelets-enh Verified on IE6,7,8 + Tomcat 6.0.26
        Hide
        yip.ng added a comment -

        Reverted changes. Caused problems for positioned panels. See ICE-5561.

        These are the original changes, in case some customer needs a patch. But be warned that they will break positioned panels.

        Index: ../../svn/ossrepo/icefaces/trunk/icefaces/component/src/com/icesoft/faces/component/panelpopup/PanelPopupRenderer.java
        ===================================================================
        — ../../svn/ossrepo/icefaces/trunk/icefaces/component/src/com/icesoft/faces/component/panelpopup/PanelPopupRenderer.java (revision 21005)
        +++ ../../svn/ossrepo/icefaces/trunk/icefaces/component/src/com/icesoft/faces/component/panelpopup/PanelPopupRenderer.java (revision 21014)
        @@ -253,7 +253,7 @@

        // Rebroadcast Javascript to survive refresh
        if (dndType != null) {

        • JavascriptContext.addJavascriptCall(facesContext, "Ice.DnD.adjustPosition('" + uiComponent.getClientId(facesContext) + "');");
          +// JavascriptContext.addJavascriptCall(facesContext, "Ice.DnD.adjustPosition('" + uiComponent.getClientId(facesContext) + "');");
          StringBuffer dropCall = new StringBuffer();
          String call = addJavascriptCalls(uiComponent, "DRAG", handleId,
          facesContext, dropCall);

        Index: ../../svn/ossrepo/icefaces/trunk/icefaces/bridge/lib/scriptaculous/dragdrop.js
        ===================================================================
        — ../../svn/ossrepo/icefaces/trunk/icefaces/bridge/lib/scriptaculous/dragdrop.js (revision 18841)
        +++ ../../svn/ossrepo/icefaces/trunk/icefaces/bridge/lib/scriptaculous/dragdrop.js (revision 21014)
        @@ -188,6 +188,10 @@

        updateDrag: function(event) {
        if (!this.activeDraggable) return;
        + if (Prototype.Browser.IE && !(event.button % 2))

        { + this.endDrag(event); + return; + }

        var pointer = [Event.pointerX(event), Event.pointerY(event)];
        // Mozilla-based browsers fire successive mousemove events with
        // the same coordinates, prevent needless redrawing (moz bug?)
        @@ -550,6 +554,28 @@
        if ((!this.options.constraint) || (this.options.constraint == 'vertical'))
        style.top = p[1] + "px";

        + var vpDims = document.viewport.getDimensions();
        + var dims = this.element.getDimensions();
        + var vpOffset = this.element.viewportOffset();
        + var posOffset = this.element.positionedOffset();
        + var diff = vpOffset.left + dims.width - (vpDims.width - 10);
        + if (diff > 0)

        { + style.left = (posOffset.left - diff) + "px"; + }

        + diff = vpOffset.top + dims.height - (vpDims.height - 10);
        + if (diff > 0)

        { + style.top = (posOffset.top - diff) + "px"; + }

        + vpOffset = this.element.viewportOffset();
        + posOffset = this.element.positionedOffset();
        + diff = 10 - vpOffset.left;
        + if (diff > 0)

        { + style.left = (posOffset.left + diff) + "px"; + }

        + diff = 10 - vpOffset.top;
        + if (diff > 0)

        { + style.top = (posOffset.top + diff) + "px"; + }

        if (style.visibility == "hidden") style.visibility = ""; // fix gecko rendering
        },

        Show
        yip.ng added a comment - Reverted changes. Caused problems for positioned panels. See ICE-5561. These are the original changes, in case some customer needs a patch. But be warned that they will break positioned panels. Index: ../../svn/ossrepo/icefaces/trunk/icefaces/component/src/com/icesoft/faces/component/panelpopup/PanelPopupRenderer.java =================================================================== — ../../svn/ossrepo/icefaces/trunk/icefaces/component/src/com/icesoft/faces/component/panelpopup/PanelPopupRenderer.java (revision 21005) +++ ../../svn/ossrepo/icefaces/trunk/icefaces/component/src/com/icesoft/faces/component/panelpopup/PanelPopupRenderer.java (revision 21014) @@ -253,7 +253,7 @@ // Rebroadcast Javascript to survive refresh if (dndType != null) { JavascriptContext.addJavascriptCall(facesContext, "Ice.DnD.adjustPosition('" + uiComponent.getClientId(facesContext) + "');"); +// JavascriptContext.addJavascriptCall(facesContext, "Ice.DnD.adjustPosition('" + uiComponent.getClientId(facesContext) + "');"); StringBuffer dropCall = new StringBuffer(); String call = addJavascriptCalls(uiComponent, "DRAG", handleId, facesContext, dropCall); Index: ../../svn/ossrepo/icefaces/trunk/icefaces/bridge/lib/scriptaculous/dragdrop.js =================================================================== — ../../svn/ossrepo/icefaces/trunk/icefaces/bridge/lib/scriptaculous/dragdrop.js (revision 18841) +++ ../../svn/ossrepo/icefaces/trunk/icefaces/bridge/lib/scriptaculous/dragdrop.js (revision 21014) @@ -188,6 +188,10 @@ updateDrag: function(event) { if (!this.activeDraggable) return; + if (Prototype.Browser.IE && !(event.button % 2)) { + this.endDrag(event); + return; + } var pointer = [Event.pointerX(event), Event.pointerY(event)] ; // Mozilla-based browsers fire successive mousemove events with // the same coordinates, prevent needless redrawing (moz bug?) @@ -550,6 +554,28 @@ if ((!this.options.constraint) || (this.options.constraint == 'vertical')) style.top = p [1] + "px"; + var vpDims = document.viewport.getDimensions(); + var dims = this.element.getDimensions(); + var vpOffset = this.element.viewportOffset(); + var posOffset = this.element.positionedOffset(); + var diff = vpOffset.left + dims.width - (vpDims.width - 10); + if (diff > 0) { + style.left = (posOffset.left - diff) + "px"; + } + diff = vpOffset.top + dims.height - (vpDims.height - 10); + if (diff > 0) { + style.top = (posOffset.top - diff) + "px"; + } + vpOffset = this.element.viewportOffset(); + posOffset = this.element.positionedOffset(); + diff = 10 - vpOffset.left; + if (diff > 0) { + style.left = (posOffset.left + diff) + "px"; + } + diff = 10 - vpOffset.top; + if (diff > 0) { + style.top = (posOffset.top + diff) + "px"; + } if (style.visibility == "hidden") style.visibility = ""; // fix gecko rendering },
        Hide
        yip.ng added a comment -

        Mouse button state (up or down) seems to change randomly for positioned panels. No good. Changed to use mouse out and toElement = null to detect mouse outside of window. Also, cancel changes to simulate YUI dialog behavior in case they cause more side effects.

        Revision: 21175


        Modified : /icefaces/trunk/icefaces/bridge/lib/scriptaculous/dragdrop.js

        Show
        yip.ng added a comment - Mouse button state (up or down) seems to change randomly for positioned panels. No good. Changed to use mouse out and toElement = null to detect mouse outside of window. Also, cancel changes to simulate YUI dialog behavior in case they cause more side effects. Revision: 21175 Modified : /icefaces/trunk/icefaces/bridge/lib/scriptaculous/dragdrop.js

          People

          • Assignee:
            Unassigned
            Reporter:
            Tyler Johnson
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: