ICEfaces
  1. ICEfaces
  2. ICE-2614

Incorrect dropValue returned by event.getTargetDropValue()

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 1.6.2
    • Fix Version/s: 1.8.1
    • Component/s: ICE-Components
    • Labels:
      None
    • Environment:
      All

      Description

      Using the attached test case, here are the steps used to reproduce the issue.

      1. Drag the red draggable square to the yellow div area.
      Console output will show:
      14:01:07,564 INFO [STDOUT] TestBean.dragListener: eventType=3, dropValue=0, dragValue=null

      2. Scroll yellow div down the bottom
      3. Drag the red draggable square to this new area of the yellow div.
      Console output will now show:
      14:01:13,911 INFO [STDOUT] TestBean.dragListener: eventType=3, dropValue=1, dragValue=null

      Notice that the drop values differ depending on where we drag the item to in the div.
      1. JIRA_2614_src.zip
        129 kB
        Tyler Johnson
      1. ScreenHunter_02 Apr. 30 16.28.jpg
        81 kB
      2. ScreenHunter_03.jpg
        72 kB
      3. ScreenHunter_04.jpg
        73 kB
      4. ScreenHunter_05.jpg
        71 kB
      5. ScreenHunter_06.jpg
        73 kB

        Activity

        Hide
        Tyler Johnson added a comment -

        Application created with MyEclipse and tested on Jboss 4.2.0.

        Show
        Tyler Johnson added a comment - Application created with MyEclipse and tested on Jboss 4.2.0.
        Hide
        Ted Goddard added a comment -

        To make the test case clearer, I adjusted the style as follows:

        <ice:panelGroup dropTarget="true" dropValue="#

        {bean.id}

        "
        style="background:yellow;height:100px;width:100px;border:2px; border-style:dotted; border-color:black">

        The source of the bug lies with Drag and Drop collision detection in the browser. It can be observed that if the red div is dropped outside the scrollable region where the yellow div is clipped, the drop event will still occur.

        Show
        Ted Goddard added a comment - To make the test case clearer, I adjusted the style as follows: <ice:panelGroup dropTarget="true" dropValue="# {bean.id} " style="background:yellow;height:100px;width:100px;border:2px; border-style:dotted; border-color:black"> The source of the bug lies with Drag and Drop collision detection in the browser. It can be observed that if the red div is dropped outside the scrollable region where the yellow div is clipped, the drop event will still occur.
        Hide
        Ted Goddard added a comment -

        This is also worth looking at after 1.7beta if other Drag and Drop JavaScript changes are being considered.

        Show
        Ted Goddard added a comment - This is also worth looking at after 1.7beta if other Drag and Drop JavaScript changes are being considered.
        Hide
        Tyler Johnson added a comment -

        Source code for test case

        Show
        Tyler Johnson added a comment - Source code for test case
        Hide
        Ken Fyten added a comment -

        This should be fixed in RC1, please retest.

        Show
        Ken Fyten added a comment - This should be fixed in RC1, please retest.
        Hide
        Sam Xiao added a comment -

        problem still presents in RC1

        Show
        Sam Xiao added a comment - problem still presents in RC1
        Hide
        Sam Xiao added a comment -

        problem still presents in latest 1.7 branch

        Show
        Sam Xiao added a comment - problem still presents in latest 1.7 branch
        Hide
        Arturo Zambrano added a comment -

        This issue has been fixed in version 1.8.2 of Scriptaculous:
        https://prototype.lighthouseapp.com/projects/8887/tickets/59-drag-drop-problem-in-scroll-div

        A patch is also available. The fix is mainly in Droppables.isAffected().

        Show
        Arturo Zambrano added a comment - This issue has been fixed in version 1.8.2 of Scriptaculous: https://prototype.lighthouseapp.com/projects/8887/tickets/59-drag-drop-problem-in-scroll-div A patch is also available. The fix is mainly in Droppables.isAffected().
        Hide
        yip.ng added a comment -

        Replaced Droppables.isAffected() with 1.8.2 version. Didn't work. Did a diff. There is no change at all from our version.

        Show
        yip.ng added a comment - Replaced Droppables.isAffected() with 1.8.2 version. Didn't work. Did a diff. There is no change at all from our version.
        Hide
        yip.ng added a comment -

        Applied patch as provided by Thomas Fuchs (author of Scriptaculous). Still doesn't work.

        Show
        yip.ng added a comment - Applied patch as provided by Thomas Fuchs (author of Scriptaculous). Still doesn't work.
        Hide
        yip.ng added a comment -

        The patch works with the test case made for it. (See attached screenshot ScreenHunter_02 Apr. 30 16.28.jpg.) Yet it doesn't work with our test case.

        Show
        yip.ng added a comment - The patch works with the test case made for it. (See attached screenshot ScreenHunter_02 Apr. 30 16.28.jpg.) Yet it doesn't work with our test case.
        Hide
        yip.ng added a comment -

        The patch requires the id of the scrollable div, but even with the addition of the scroller id (hardcoded for now, may require addition of scroller id attribute later), it still doesn't work. Now if you scroll down to the bottom yellow div's to do the drag and drop, no event seems to happen at all. See screenshots ScreenHunter_03.jpg and ScreenHunter_04.jpg.

        Show
        yip.ng added a comment - The patch requires the id of the scrollable div, but even with the addition of the scroller id (hardcoded for now, may require addition of scroller id attribute later), it still doesn't work. Now if you scroll down to the bottom yellow div's to do the drag and drop, no event seems to happen at all. See screenshots ScreenHunter_03.jpg and ScreenHunter_04.jpg.
        Hide
        yip.ng added a comment -

        Seems we have introduced some bug(s) when overriding the Droppables.show() function in Scriptaculous. If we go back to the original Droppables.show() function (not involved in the patch), the event firing seems to work fine.

        Show
        yip.ng added a comment - Seems we have introduced some bug(s) when overriding the Droppables.show() function in Scriptaculous. If we go back to the original Droppables.show() function (not involved in the patch), the event firing seems to work fine.
        Hide
        yip.ng added a comment -

        Fixed our overriding show() function. This together with the patched isAffected() function from Scriptaculous fixed the issue. See screenshots ScreenHunter_05.jpg and ScreenHunter_06.jpg.

        The new isAffected() function needs to know the id of the scroller. It's been hardcoded so far.

        Next, we need to add a scroller id attribute and pass it to Scriptaculous.

        Show
        yip.ng added a comment - Fixed our overriding show() function. This together with the patched isAffected() function from Scriptaculous fixed the issue. See screenshots ScreenHunter_05.jpg and ScreenHunter_06.jpg. The new isAffected() function needs to know the id of the scroller. It's been hardcoded so far. Next, we need to add a scroller id attribute and pass it to Scriptaculous.
        Hide
        yip.ng added a comment -

        Done. Note that you need to use the new attribute (dropTargetScrollerId) for the fix to work:

        <div id="scrolling_div" ...>
        <ice:panelSeries ...>
        <ice:panelGroup dropTarget="true" dropTargetScrollerId="scrolling_div" ...>
        ...
        </ice:panelGroup>
        </ice:panelSeries>
        </div>

        Show
        yip.ng added a comment - Done. Note that you need to use the new attribute (dropTargetScrollerId) for the fix to work: <div id="scrolling_div" ...> <ice:panelSeries ...> <ice:panelGroup dropTarget="true" dropTargetScrollerId="scrolling_div" ...> ... </ice:panelGroup> </ice:panelSeries> </div>

          People

          • Assignee:
            yip.ng
            Reporter:
            Tyler Johnson
          • Votes:
            2 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: