Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue with disableSorting when using SimpleTreeWrapper #12

Open
Phazia opened this issue Nov 5, 2022 · 3 comments
Open

Issue with disableSorting when using SimpleTreeWrapper #12

Phazia opened this issue Nov 5, 2022 · 3 comments

Comments

@Phazia
Copy link

Phazia commented Nov 5, 2022

Tried applying the disableSorting property as a prop in the SimpleTreeWrapper, but sorting is still enabled for the item.

It appears that when console logging the props object, it's undefined and getting reset to undefined on each render. Any ideas why?

Will attach a video soon.

@Phazia Phazia changed the title Hmm. Tried applying that property as a prop in the SimpleTreeWrapper to no avail. It appears that when console logging the props object, it's undefined and getting reset to undefined on each render. Any ideas why? Issue with disableSorting when using SimpleTreeWrapper Nov 5, 2022
@Shaddix
Copy link
Owner

Shaddix commented Nov 7, 2022

I'd think about making this more clear on the API level..
Currently you need to set disableSorting for the item in the items data provided to the SortableTree (check the sample:

)

@Phazia
Copy link
Author

Phazia commented Nov 7, 2022

image

I've added the property to the item-data object (referencing the above photo). I've also added properties like canHaveChildren which work as intended.

When console logging the props, I'm seeing undefined values for disableSorting:
image

Setting the entire tree to have disableSorting works as intended.

Also, thank you for your patience! Will take a look at the source code later this week if there's a bug and make a PR once solved.

@Adam-rGz
Copy link

I have same problem. canHaveChildren works perfectly for items, but disableSorting not. Any fixes?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants