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

utils.initSlotItemMap(users.value, 'userId') return userId: userId in map #108

Closed
AMontagu opened this issue Jan 2, 2025 · 2 comments
Closed

Comments

@AMontagu
Copy link

AMontagu commented Jan 2, 2025

Hello,

Using Swapy 1.0.3. I follow this how to : https://swapy.tahazsh.com/docs/framework-vue-dynamic/

When using utils.initSlotItemMap(users.value, 'userId') it return a map where key and value are both userId. This is a little bit confusing.

Is it a normal behavior ?

Also when using the onSwapEnd event the event value has the hasChanged attribute to False. Also the list data even if the slot value have changed the array order is still the same than before the swap.

@TahaSh
Copy link
Owner

TahaSh commented Jan 19, 2025

Hi! Yes it's expected to return the same id for each slot and item. Does this cause any issue on your end?
Re: hasChanged, it's now fixed in v1.0.5!

@AMontagu
Copy link
Author

Only some confusion when I used to update the wrong element because I used the wrong key to update the element (and the hasChanged bug made me even more difficult to understant)

To resume: I took an id and has the order doesnt' change beacuse of the bug I thought the key to use was the sloted one instead of the ID.

Will test the fix of hasChanged later this week. Thank you.

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

2 participants