imacrayon / alpine-ajax

An Alpine.js plugin for building server-powered frontends.

Home Page:https://alpine-ajax.js.org

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

New links are not progressively enhanced

imacrayon opened this issue · comments

Links added to the DOM after an Ajax component is initialized are not progressively enhanced.

The work around for now is to add thex-ajax directive to new links. The directive will trigger an Alpine component to re-initialize.

I think the fix for this is to use morph’s added(el) hook. When a link element is patched into the DOM progressively enhance it if it belongs to an AJAX component.