ICEfaces
  1. ICEfaces
  2. ICE-7530

panelTooltip y positioning incorrect, tooltip displays far from where the hover occurs on the parent panelGroup element

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Invalid
    • Affects Version/s: 1.8.2
    • Fix Version/s: None
    • Component/s: Bridge
    • Labels:
      None
    • Environment:
      ICEfaces 1.8.3 (trunk)
      Liferay 6.0.6 GA
      Seam 2.2.2 Final
      Facelets

      Description

      This is similar to ICE-5607:

      http://jira.icefaces.org/browse/ICE-5607

      The panelTooltip is displayed far from where the hover occurs (much lower than expected, nearly off the browser viewing area) when one hovers over the panelGroup element that is defined for the panel tooltip. In my case, I'm using the tooltip component within a datatable which is contained within a portlet. Here's a snippet of the markup:

      <ice:dataTable value="#{pooledItemList}" var="task">
      <ice:column>
      <ice:panelGroup panelTooltip="descriptionItemPanelToolTip">
      <ice:panelTooltip id="descriptionItemPanelToolTip" hideOn="mousedown" hoverDelay="500">
      ...

      I looked at tooltip_panelpopup.js and traced it down to the following line (revision 26133) in adjustPosition:

      if (y - elementDimensions.height - tooltipOffset < viewportScrollOffsets.top) {
             //align tooltip's top edge with the top edge of the view port
             element.style.top = (y + viewportScrollOffsets.top - elementOffsets.top) + 'px';
      }

      I was getting the following values for the above properties:
      y: 317
      elementDimensions.height: 544
      tooltipOffset: 4
      viewportScrollOffsets.top: 0
      viewportScrollOffsets.tip: 0
      elementOffsets.top: -231

      The offending property value seems to be the value for elementOffsets.top. Seems like we shouldn't subtract the elementOffsets.top value in the calculation for the element top value (since the offset will typically be negative? Not very familiar with JQuery). Unfortunately, I still don't think I fully comprehend the entire context of the calculation, so I may be wrong here. But my fix just involved changing the subtraction to an addition:

      if (y - elementDimensions.height - tooltipOffset < viewportScrollOffsets.top) {
             //align tooltip's top edge with the top edge of the view port
             element.style.top = (y + viewportScrollOffsets.top + elementOffsets.top) + 'px';
      }

      After that change was made, the y positioning of the popup was correct. Again, I'm not entirely sure if this is the correct fix though, but it does seem to work.

        Activity

        zzzz8 zzzz8 created issue -
        Hide
        Ken Fyten added a comment -

        Marking as Closed / Invalid as part of legacy ICEfaces 1.x, 2.x JIRA cleanup.

        Note: This issue may be resolved in a newer ICEfaces release, available here: http://www.icesoft.org/java/downloads/icefaces-downloads.jsf

        If the issue persists with the current ICEfaces release, please create a new JIRA for it.

        Show
        Ken Fyten added a comment - Marking as Closed / Invalid as part of legacy ICEfaces 1.x, 2.x JIRA cleanup. Note: This issue may be resolved in a newer ICEfaces release, available here: http://www.icesoft.org/java/downloads/icefaces-downloads.jsf If the issue persists with the current ICEfaces release, please create a new JIRA for it.
        Ken Fyten made changes -
        Field Original Value New Value
        Status Open [ 1 ] Closed [ 6 ]
        Resolution Invalid [ 6 ]

          People

          • Assignee:
            Unassigned
            Reporter:
            zzzz8 zzzz8
          • Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: