Skip to content

docs(useSortable): moveArrayElement arguments #4904

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

Merged
merged 1 commit into from
Jul 24, 2025

Conversation

doyuli
Copy link
Contributor

@doyuli doyuli commented Jul 23, 2025

Description

closed: #4902

When moveArrayElement passes the value of shallowRef list.value , the responsive setter will not be triggered

import { moveArrayElement } from '@vueuse/integrations/useSortable'

useSortable(el, list, {
  onUpdate: (e) => {
    // If the passed list is a shallowRef, then the responsive setter will not be triggered.
    // If it is a deepRef, there will be no such problem.
    moveArrayElement(list.value, e.oldIndex, e.newIndex, e)
  }
})
// So in the document, if you pass in a ref, there will be no such problem.
moveArrayElement(list, e.oldIndex, e.newIndex, e)

@dosubot dosubot bot added size:XS This PR changes 0-9 lines, ignoring generated files. documentation Improvements or additions to documentation labels Jul 23, 2025
@dosubot dosubot bot added the lgtm This PR has been approved by a maintainer label Jul 23, 2025
@ilyaliao ilyaliao added this pull request to the merge queue Jul 23, 2025
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Jul 23, 2025
@ilyaliao ilyaliao added this pull request to the merge queue Jul 24, 2025
Merged via the queue into vueuse:main with commit f23d81d Jul 24, 2025
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation lgtm This PR has been approved by a maintainer size:XS This PR changes 0-9 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

docs: useSortable - incorrect usage of the argument on moveArrayElement
4 participants
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy