You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When dragging an item to the end of a list with a non-virtual vertical layout, the following error is thrown:
TypeError: Error #1009: Cannot access a property or method of a null object reference.
at feathers.layout::VerticalLayout/getDropIndex()[C:\Users\josht\Development\feathersui\feathersui-starling-sdk\frameworks\projects\feathers\feathers\source\feathers\layout\VerticalLayout.as:1643]
In VirticalLayout.as, item.y is accessed without testing for the existence of item.
@joshtynjala I have the same issue + two more. All issues are related to drag and drop.
First, with useVirtualLayout = true and hasVariableItemDimensions = true I got this:
In VirtualLayout.as in function positionDropIndicator() lines 1550-1551 items[indexMinusOffset] results null.
Since the items are virtual, not all of them are constructed and somehow this gives an error. This prompted me to stop using a virtual layout.
Second, with useVirtualLayout = false I got this:
In VirtualLayout.as in function getDropIndex() lines 1636 positionY = item.y; item is null and get Err:1009
This I managed to debug a bit:
var itemCount:int = items.length;
var totalItemCount:int = itemCount;
if(this._useVirtualLayout && !this._hasVariableItemDimensions)
{
totalItemCount += this._beforeVirtualizedItemCount + this._afterVirtualizedItemCount;
indexOffset = this._beforeVirtualizedItemCount;
}
var secondToLastIndex:int = totalItemCount - 2;
for(var i:int = 0; i <= totalItemCount; i++)
{
var item:DisplayObject = null;
var indexMinusOffset:int = i - indexOffset;
if(indexMinusOffset >= 0 && indexMinusOffset < itemCount)
{
item = items[indexMinusOffset];
}
In the for, i <= totalItemCount and totalItemCount = items.length and it's running out of bounds. Apparently by fixing the sign the problem goes away.
Third, while testing on the List in the component explorer, the item being dragged, changed text. I think data is still being referenced from the initial object and that changes with the virtual layout.
When dragging an item to the end of a list with a non-virtual vertical layout, the following error is thrown:
In VirticalLayout.as,
item.y
is accessed without testing for the existence ofitem
.Below is an example to recrate the issue:
The text was updated successfully, but these errors were encountered: