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

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

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Normal Normal
    • 8.5.0
    • 8.0.4
    • None
    • Security Level: Jimmy
    • None
    • IE 11

      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>
      
      

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

              Created:
              Updated:
              Resolved:

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