ICEfaces
  1. ICEfaces
  2. ICE-9244

autoCompleteEntry - when Height is specified, click on scrollbox close it without selection

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 3.3
    • Fix Version/s: EE-3.3.0.GA, 4.0.BETA, 4.0
    • Component/s: ACE-Components
    • Labels:
      None
    • Environment:
      Internet explorer (version 8)
    • Assignee Priority:
      P1
    • Workaround Exists:
      Yes
    • Workaround Description:
      Hide
      Also I found a solution. I chnaged part of autocompleteentry.js :

      Current:
       onBlur: function(event) {
              var input = ice.ace.jq(this.element);
              if (ice.ace.jq.trim(input.val()) == "" && this.cfg.inFieldLabel) {
                  input.val(this.cfg.inFieldLabel);
                  input.addClass(this.cfg.inFieldLabelStyleClass);
                  input.data("labelIsInField", true);
              }
              if (navigator.userAgent.indexOf("MSIE") >= 0) { // ICE-2225
                  var strictMode = document.compatMode && document.compatMode == "CSS1Compat";
                  var docBody = strictMode ? document.documentElement : document.body;
                  // Right or bottom border, if any, will be treated as scrollbar.
                  // No way to determine their width or scrollbar width accurately.
                  if (event.clientX > docBody.clientLeft + docBody.clientWidth ||
                      event.clientY > docBody.clientTop + docBody.clientHeight) {
                      this.element.focus();
                      return;
                  }
              }
      ...

      Fix:

          onBlur: function(event) {
              var input = ice.ace.jq(this.element);
              if (ice.ace.jq.trim(input.val()) == "" && this.cfg.inFieldLabel) {
                  input.val(this.cfg.inFieldLabel);
                  input.addClass(this.cfg.inFieldLabelStyleClass);
                  input.data("labelIsInField", true);
              }
              if (navigator.userAgent.indexOf("MSIE") >= 0) { // ICE-2225
                  var strictMode = document.compatMode && document.compatMode == "CSS1Compat";
                  var docBody = strictMode ? document.documentElement : document.body;
                  //FIX is height is set and user click on scrollbar. If height is not set, value=auto
               var n=this.height;
               if (n!=null && n!='' && typeof n === 'number' && n % 1 == 0) {
                      var posx=0; var posy=0;
                      var e = window.event;
                   if (e.pageX || e.pageY) {
                   posx = e.pageX;
                   posy = e.pageY;
                   } else if (e.clientX || e.clientY) {
                   posx = e.clientX + document.body.scrollLeft + document.documentElement.scrollLeft;
                   posy = e.clientY + document.body.scrollTop + document.documentElement.scrollTop;
                   }
                   var widthX=input.position().left+input.width();
                   var heightX=input.position().top+input.height()+parseFloat(this.height)+10;
      if ( (posx>input.position().left && posx<=widthX) && (posy>input.position().top && posy<heightX) ) {
      this.element.focus();
      return;
      }
               }
                  // Right or bottom border, if any, will be treated as scrollbar.
                  // No way to determine their width or scrollbar width accurately.
                  if (event.clientX > docBody.clientLeft + docBody.clientWidth ||
                      event.clientY > docBody.clientTop + docBody.clientHeight) {
                      this.element.focus();
                      return;
                  }
              }
      ...
      Show
      Also I found a solution. I chnaged part of autocompleteentry.js : Current:  onBlur: function(event) {         var input = ice.ace.jq(this.element);         if (ice.ace.jq.trim(input.val()) == "" && this.cfg.inFieldLabel) {             input.val(this.cfg.inFieldLabel);             input.addClass(this.cfg.inFieldLabelStyleClass);             input.data("labelIsInField", true);         }         if (navigator.userAgent.indexOf("MSIE") >= 0) { // ICE-2225             var strictMode = document.compatMode && document.compatMode == "CSS1Compat";             var docBody = strictMode ? document.documentElement : document.body;             // Right or bottom border, if any, will be treated as scrollbar.             // No way to determine their width or scrollbar width accurately.             if (event.clientX > docBody.clientLeft + docBody.clientWidth ||                 event.clientY > docBody.clientTop + docBody.clientHeight) {                 this.element.focus();                 return;             }         } ... Fix:     onBlur: function(event) {         var input = ice.ace.jq(this.element);         if (ice.ace.jq.trim(input.val()) == "" && this.cfg.inFieldLabel) {             input.val(this.cfg.inFieldLabel);             input.addClass(this.cfg.inFieldLabelStyleClass);             input.data("labelIsInField", true);         }         if (navigator.userAgent.indexOf("MSIE") >= 0) { // ICE-2225             var strictMode = document.compatMode && document.compatMode == "CSS1Compat";             var docBody = strictMode ? document.documentElement : document.body;             //FIX is height is set and user click on scrollbar. If height is not set, value=auto          var n=this.height;          if (n!=null && n!='' && typeof n === 'number' && n % 1 == 0) {                 var posx=0; var posy=0;                 var e = window.event;              if (e.pageX || e.pageY) {              posx = e.pageX;              posy = e.pageY;              } else if (e.clientX || e.clientY) {              posx = e.clientX + document.body.scrollLeft + document.documentElement.scrollLeft;              posy = e.clientY + document.body.scrollTop + document.documentElement.scrollTop;              }              var widthX=input.position().left+input.width();              var heightX=input.position().top+input.height()+parseFloat(this.height)+10; if ( (posx>input.position().left && posx<=widthX) && (posy>input.position().top && posy<heightX) ) { this.element.focus(); return; }          }             // Right or bottom border, if any, will be treated as scrollbar.             // No way to determine their width or scrollbar width accurately.             if (event.clientX > docBody.clientLeft + docBody.clientWidth ||                 event.clientY > docBody.clientTop + docBody.clientHeight) {                 this.element.focus();                 return;             }         } ...

      Description

      If on <ace:autoCompleteEntry> we specify height, and scrollbox with some values appear, if we click on scrollbox, it is automatically closed.

      This issue occur on IE. On Firefox working OK.

      I investigated this issue and problem is that when we click on scrollbox, onblur event is fired (on IE).

        Issue Links

          Activity

            People

            • Assignee:
              Arturo Zambrano
              Reporter:
              Zoran Djuric
            • Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: