Coder Social home page Coder Social logo

Comments (2)

Adrian-S avatar Adrian-S commented on June 10, 2024

@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.

image

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.

from feathersui-starling.

Adrian-S avatar Adrian-S commented on June 10, 2024

This is a fix for the first and second problem.

DragVerticalLayout.txt

from feathersui-starling.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.