You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@myfaces.apache.org by "Andrew Robinson (JIRA)" <de...@myfaces.apache.org> on 2007/09/03 00:59:19 UTC

[jira] Resolved: (TRINIDAD-673) tr:panelPopup positions itself with regards to the document body, not the offset parent

     [ https://issues.apache.org/jira/browse/TRINIDAD-673?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Andrew Robinson resolved TRINIDAD-673.
--------------------------------------

       Resolution: Fixed
    Fix Version/s: 1.0.3-core

Committed revision 572158.

I made the changes that I described in the bug. The popup is now moved to the form or document.body when shown, and moved back when it is hidden. I tested it in IE7 and Firefox 2 and IE6.

IE is having positioning issues if the HTML element scrolls (as seen in the demo). The problem existed before in the demo.

> tr:panelPopup positions itself with regards to the document body, not the offset parent
> ---------------------------------------------------------------------------------------
>
>                 Key: TRINIDAD-673
>                 URL: https://issues.apache.org/jira/browse/TRINIDAD-673
>             Project: MyFaces Trinidad
>          Issue Type: Bug
>          Components: Components
>    Affects Versions: 1.0.2-core
>            Reporter: Andrew Robinson
>            Assignee: Andrew Robinson
>             Fix For: 1.0.3-core
>
>         Attachments: popup.js
>
>
> I have been working for a large part of the day on my own renderer of the tr:panelPopup as the core one unfortunately doesn't work for my needs. The problem is that the PanelPopup.js assumes that the panel's offsetParent is the document.body/window. With CSS styling, this is very rarely the case. As a result a tr:panelPopup inside of a relative or absolute HTML element will not be rendered in the correct location on the screen. 
> Furthermore, the panel is often not visible if the parent's overflow is hidden. 
> Proposed solution:
> The best way to ensure that the popup is positioned correctly is to have all measurements made using absolute (page) co-ordinates. Also, it is imperative to have the popup inside a container that is not cropped or scrolling in any way to ensure the dialog stays visible. 
> Steps:
> 1) When the popup is shown, move it to the parent FORM element (use the form to ensure that form elements inside the popup do not break)
> 2) if the popup is not in a form, then relocate the popup to the document.body
> 3) have event listeners on the popup and the trigger.
> 4) in the mouse out, check to see if the events X and Y co-ordinates fall in the page X and page Y co-ordinates of either the trigger or the popup. If the event is outside both sets of co-ordinates, hide the popup
> 5) when hiding the popup, move it back to it's original parent
> Technical notes:
> - to determine absolute co-ordinates relative to the page, one must loop through all the parent nodes, checking offsetTop and offsetLeft until the offsetParent is null

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.