4 Replies Latest reply on Mar 20, 2009 12:06 PM by Alessio Maggiori

    rich:contextMenu on div with scroll

    Anne Buit Newbie


      When a contextmenu is attached to a component located on a div with overflow:scroll, the contextmenu is rendered at the wrong position when the div is scrolled.

      Using the demo example, change the code of WebContent\contextMenu\example\menu.xhtml to the following (line 21 to 29)

      <h:panelGroup id="picture">
       <div style="overflow: scroll; width: 100px; height: 100px;">
       <h:graphicImage value="/richfaces/jQuery/images/pic1.jpg" id="pic" style="border : 5px solid #E4EAEF"/>
       <rich:contextMenu event="oncontextmenu" attachTo="pic" submitMode="none">
       <rich:menuItem value="Zoom In" onclick="enlarge('pic');" id="zin"></rich:menuItem>
       <rich:menuItem value="Zoom Out" onclick="decrease('pic');" id="zout"></rich:menuItem>

      Now scroll the picture to the left or down, and bring up the context menu using right-click.

      I hope you will be able to fix this or provide a workaround :) Thank you for your time!