feathersui / feathersui-starling

User interface components for Starling Framework and Adobe AIR
https://feathersui.com/learn/as3-starling/
Other
915 stars 386 forks source link

[Bug] ItemRenderer, Drag&Drop with HorizontalLayout and HorizontalAlign.CENTER #1766

Closed subdan closed 5 years ago

subdan commented 5 years ago

Hello.

In my app I use a List with this layout:

var layout:HorizontalLayout = new HorizontalLayout();
layout.horizontalAlign = HorizontalAlign.CENTER;
list.layout = layout;

Drag&drop works incorrect when I set layout.horizontalAlign = HorizontalAlign.CENTER;.

To explain the issue I've recorded two video:

  1. Without layout.horizontalAlign = HorizontalAlign.CENTER;
  2. With layout.horizontalAlign = HorizontalAlign.CENTER;

As you can see when I set layout.horizontalAlign = HorizontalAlign.CENTER; distance between dropIndicator and ItemRenderer is very big. There is an offset. This issue happens only when number of items is less than List width. Could you fix it?

subdan commented 5 years ago

There is another issue I've found right now. screenshot_1 If I set layout.verticalAlign = VerticalAlign.MIDDLE; then Y position of dropIndicator is incorrect. dropIndicator's Y position must me equal to ItemRenderer's Y position.

subdan commented 5 years ago

Is it possible to add delay before ItemRenderer starts to drag to avoid drag&drop while scrolling.

joshtynjala commented 5 years ago

Is it possible to add delay before ItemRenderer starts to drag to avoid drag&drop while scrolling.

Not at this time. If you're using DefaultListItemRenderer, you should provide a dragIcon. If you have a custom item renderer, you should implement IDragAndDropItemRenderer and provide a dragProxy for the same purpose. This will allow a small region of your item renderer to be draggable, while you can touch other parts of the item renderer to scroll.

joshtynjala commented 5 years ago

Fixed. Thanks!

subdan commented 5 years ago

Thank you!