Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
calebporzio committed Nov 28, 2024
1 parent 8b6c31c commit 0e7e75e
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 21 deletions.
30 changes: 11 additions & 19 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -11,25 +11,17 @@
<!-- <script src="//cdn.tailwindcss.com"></script> -->
<!-- <script src="//cdn.tailwindcss.com"></script> -->

<script>
let count = 0;
document.addEventListener("alpine:init", () => {
Alpine.directive("test", (el, _, { cleanup }) => {
el.textContent = "Initialized";
cleanup(() => {
el.textContent = "Cleaned up";
});
// Alpine.nextTick(() => {
// el.parentNode.replaceChildren(el);
// })
});
});
</script>
<div x-data>
<div x-ref="anchor"></div>

<div x-ref="target" class="bg-red-300 w-32 h-32" x-test></div>
<div x-data x-sort>
<div x-sort:item >foo</div>
<div >foo</div>
<div x-sort:item >foo</div>
</div>

<button @click="$refs.anchor.before($refs.target)">Move</button>
<div x-data="{ val: true }"
>
<input type="text" x-model.boolean="val">
<input type="checkbox" x-model.boolean="val">
<input type="radio" name="foo" value="true" x-model.boolean="val">
<input type="radio" name="foo" value="false" x-model.boolean="val">
</div>
</html>
2 changes: 0 additions & 2 deletions packages/alpinejs/src/mutation.js
Original file line number Diff line number Diff line change
Expand Up @@ -112,8 +112,6 @@ export function flushAndStopDeferringMutations() {
}

function onMutate(mutations) {
console.log(mutations);

if (isCollecting) {
deferredMutations = deferredMutations.concat(mutations)

Expand Down

0 comments on commit 0e7e75e

Please sign in to comment.