Closed imacrayon closed 1 year ago
Being able to append elements to a target would also improve the Notifications example. Right now the implementation just replaces the same message on the page when you spam the button.
My plan right now is to add support for an arrange
attribute. Supported values would be before
, prepend
, replace
, append
, after
, delete
.
This attribute could be added to an AJAX Component and it would control the way incoming content is handled by that component. Essentially before
, prepend
, append
, after
, would take the innerHTML
of the incoming content and insert it in the appropriate place. replace
and delete
would handle the outerHTML
.
I’m open to bike shedding these names.
Added in c336e4c
Infinite scroll is tricky because it requires that we append new server content rather than replace it. In the interest of keeping things simple I intended to allow only replacing DOM content in Apline AJAX, but it looks like we might need to support additional ways to add content to the page.