Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion packages/sort/src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ export default function (Alpine) {
let preferences = {
hideGhost: ! modifiers.includes('ghost'),
useHandles: !! el.querySelector(handleSelector)
|| Array.from(el.querySelectorAll('template')).some(tmpl => tmpl.content.querySelector(handleSelector)),
|| Array.from(el.querySelectorAll('template:not(svg template)')).some(tmpl => tmpl.content?.querySelector(handleSelector)),
group: getGroupName(el, modifiers),
}

Expand Down
15 changes: 15 additions & 0 deletions tests/cypress/integration/plugins/sort.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -237,6 +237,21 @@ test.skip('can use custom sortablejs configuration',
},
)

test('does not throw when a sort item contains a template inside an SVG',
[html`
<div x-data>
<ul x-sort>
<li id="1"><svg><template name="line"><path></path></template></svg>foo</li>
<li id="2">bar</li>
</ul>
</div>
`],
({ get }) => {
get('ul li').eq(0).should(haveText('foo'))
get('ul li').eq(1).should(haveText('bar'))
},
)

test.skip('works with Livewire morphing',
[html`
<div x-data>
Expand Down
Loading