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

@sort-end on multi-list #192

Open
bhaviljain68 opened this issue May 10, 2023 · 0 comments
Open

@sort-end on multi-list #192

bhaviljain68 opened this issue May 10, 2023 · 0 comments

Comments

@bhaviljain68
Copy link

bhaviljain68 commented May 10, 2023

Hi @Jexordexan,

I have set up slick sort on a multi-list form (a form builder rather)

The structure of the form object is an array of arrays like this

section //[0]
    -question //[0]
    -question //[1]
section //[1]
    -question //[0]
    -question //[1]
.......

The sorting works fine, no issues there.

So... to avoid the user having to scroll a lot, as the form can get very long.
I have an 'active question' logic, where in, only 1 question (the active question) will show the various options related to the question (delete, inputs, various action buttons etc.) and all the other questions will be collapsed, showing only the question statement.

I do this by setting an activeQuestion object that holds the sectionIndex and the qestionIndex values. Eg.

let activeQuestion= ref({
    sectionIndex: 0,
    questionIndex: 1
})

@sort-end gives the old and new index when dragging and dropping in the same list and that works fine as I don't have to change the sectionIndex.

Correct me if I'm wrong... But when DnD-ing between lists, the @sort-end doesn't fire, I think.

Is there a way to know which list was an element dropped into?

Thanks

PS : I'm using Vue3 in a Laravel+Inertia app

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

1 participant