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

Some Options are overrided in Sortable.create #22

Closed
archgeko opened this issue May 30, 2023 · 3 comments
Closed

Some Options are overrided in Sortable.create #22

archgeko opened this issue May 30, 2023 · 3 comments

Comments

@archgeko
Copy link

I noticed that some options are overrided after you spread the "options" object

el.livewire_sortable = window.Sortable.create(el, {
        ...options,
        draggable: '[wire\\:sortable-group\\.item]',
        handle: el.querySelector('[wire\\:sortable-group\\.handle]') ? '[wire\\:sortable-group\\.handle]' : null,
        sort: true, 
        dataIdAttr: 'wire:sortable-group.item',
        group: {
            name: el.closest('[wire\\:sortable-group]').getAttribute('wire:sortable-group'),
            pull: true,
            put: true,
        },
....
}

Options like "sort" and "group.pull", "group.put" are set After the spread operator on options and overrides the ones you set in your blade

GC

@gdebrauwer
Copy link
Contributor

gdebrauwer commented Aug 25, 2023

Fixed #23 / v0.2.1.

@boothy060590
Copy link

The "sort" option is still overidden. This prevents us from setting up grouped lists that are unsortable but items can cloned from one another.

@gdebrauwer
Copy link
Contributor

@boothy060590 This has been fixed in v0.3.2 (and v0.2.2)

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