imacrayon / alpine-ajax

An Alpine.js plugin for building server-powered frontends.
https://alpine-ajax.js.org
MIT License
558 stars 11 forks source link

x-sync deletes div if no matching id in response #77

Closed ma2thieu closed 3 months ago

ma2thieu commented 3 months ago

Hello, I don't know if this is the intended behaviour but if I have a div with a x-sync like <div x-sync id="notifications"> everything works fine as long as the responses from the server include a div with id="notifications" but if one response doesn't then the div is being deleted (and the notification system is broken)

imacrayon commented 3 months ago

Hey, thanks for reporting this. Yes, I think this is a regression. We probably need to make an exception for x-sync elements around this line.