Uploaded image for project: 'ZK'
  1. ZK
  2. ZK-3608

Click in scrolled navbar cause up jump after ZK-3230 in IE

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Normal
    • Resolution: Fixed
    • Affects Version/s: 8.0.4
    • Fix Version/s: 8.5.0
    • Component/s: None
    • Security Level: Jimmy
    • Labels:
      None
    • Environment:

      IE 11

      Description

      Steps to Reproduce

      Play fiddle:
      http://zkfiddle.org/sample/22tagcb/1-IE-navbar-Jump
      Open the 2nd navitem
      Resize the window to cause a scrollbar
      Scroll down to last item
      Click last item

      Actual Result

      navbar scroll jump up
      item selection doesn't trigger

      Expected Result

      Navbar scroll doesn't change
      item selection triggers

      Debug Info

      Comment out this section in fiddle to remove ZK-3230 fix

      							//	if (zk.ie) {
      							//		oldStyle = wgtVParent.style.position;
      							//		wgtVParent.style.position = 'fixed';
      							//	}
      							// DO NOT COMMENT OUT FOCUS
      								wgt.focus();
      							//	if (zk.ie) wgtVParent.style.position = oldStyle;
      

      Root Cause

      Caused by change of css position attribute during zk.Widget.mimicMouseDown

      Workaround

      remove previous fix while waiting for this ticket

      <script><![CDATA[
      		zk.afterLoad('zk', function() {
      			var xWidget = {};
      			zk.override(zk.Widget, xWidget ,{
      				mimicMouseDown_: function (wgt, noFocusChange, which) { //called by mount
      					var modal = zk.currentModal;
      					if (modal && !wgt) {
      						var cf = zk.currentFocus;
      						//Note: browser might change focus later, so delay a bit
      						//(it doesn't work if we stop event instead of delay - IE)
      						if (cf && zUtl.isAncestor(modal, cf)) cf.focus(0);
      						else modal.focus(0);
      					} else if (!wgt || wgt.canActivate()) {
      						if (!noFocusChange) {
      							var wgtVParent;
      							zk._prevFocus = zk.currentFocus;
      							zk.currentFocus = wgt;
      							if (wgt && (wgtVParent = wgt.$n('a')) && jq.nodeName(wgtVParent, 'button', 'input', 'textarea', 'a', 'select', 'iframe')) {
      								//ZK-3230: ie lost the focus when click on scroll bar, to prevent scroll into view automatically, set VParent's position to "fixed" temporary.
      								var oldStyle;
      							//	if (zk.ie) {
      							//		oldStyle = wgtVParent.style.position;
      							//		wgtVParent.style.position = 'fixed';
      							//	}
      							// DO NOT COMMENT OUT FOCUS
      								wgt.focus();
      							//	if (zk.ie) wgtVParent.style.position = oldStyle;
      							}
      							zk._cfByMD = true;
      							setTimeout(function () {zk._cfByMD = false; zk._prevFocus = null;}, 0);
      								//turn it off later since onBlur_ needs it
      						}
      	
      						if (wgt) // F70-ZK-2007: Add the button number information.
      							zWatch.fire('onFloatUp', wgt, {triggerByClick: which}); //notify all
      						else
      							for (var dtid in zk.Desktop.all)
      								zWatch.fire('onFloatUp', zk.Desktop.all[dtid]); //notify all
      					}
      				}
      			});//zk.override
      		});//zk/afterLoad
      	]]></script>
      
      

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              rudyhuang rudyhuang
              Reporter:
              MDuchemin MDuchemin
              Votes:
              1 Vote for this issue
              Watchers:
              3 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:

                  Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - 0 minutes
                  0m
                  Logged:
                  Time Spent - 4 hours
                  4h