Skip to content

plugin/fragment: node order breaks after updating Alpine.js #62

Description

@rameel

Updating Alpine.js to 3.16.2 breaks node ordering when using x-fragment.
It reliably reproduces with 3 items, with other counts it looks fine on a quick check.

<!doctype html>
<html>
<body>
  <div x-data="{ items: [1, 2, 3] }">
    <button type="button" @click="items.reverse()">Reverse</button>
    <template x-for="n in items" :key="n">
      <template x-fragment>
        <span x-text="n"></span>:<span x-text="n"></span>
      </template>
    </template>
  </div>
  <script src="https://cdn.jsdelivr.net/npm/@ramstack/alpinegear-fragment@1.5.0/alpinegear-fragment.min.js"></script>
  <script src="https://cdn.jsdelivr.net/npm/alpinejs@3.16.2/dist/cdn.min.js"></script>
</body>
</html>

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions