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

Dropzone: Reordered property to expose current order #5834

Merged
merged 7 commits into from
Nov 13, 2024

Conversation

tesar-tech
Copy link
Collaborator

@tesar-tech tesar-tech commented Nov 11, 2024

Closes #5830

360d019e-276b-461c-9b66-6a346552bd88.mp4

This function triggers every time the order changes:

  • when an item is dragged to a new position
  • when an item is added from a different zone
  • when an item is removed

While removing and adding items isn’t technically reordering, I believe these actions should also trigger the function.

Currently, it also fires when a user drags an item and drops it back in the same position. While this doesn’t alter the collection, the function still invokes. We could compare the old and new dictionary to prevent this, but is it worth the additional complexity?

@mkontula
Copy link

@tesar-tech From the my perspective adding and removing items for example from zone "all options" to "selected and ordered options" is a reordering since you can drop the new item in any position in "selected and ordered options". Also when you remove an item from "selected and ordered options", you would expect the "selected and ordered options" internal and exposed order to be coherent and without gaps.

@stsrki
Copy link
Collaborator

stsrki commented Nov 12, 2024

Got some more ideas and added dropzone names to the DropZoneOrder as I think it will be useful to the users. Please review.

# Conflicts:
#	Documentation/Blazorise.Docs/Pages/News/2024-10-15-release-notes-170.razor
@stsrki stsrki merged commit cefc829 into master Nov 13, 2024
1 of 2 checks passed
@stsrki stsrki deleted the dev/dropzone-expose-internal-order branch November 13, 2024 08:41
@github-actions github-actions bot locked and limited conversation to collaborators Nov 13, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Expose internal order of DropZone items when AllowReorder is enabled
3 participants