https://htmx.org logo
We currently have 2 issues with Astro using HTMX: ...
# htmx-general
s
We currently have 2 issues with Astro using HTMX: * merging doesn't work, so HTMX is unusable for web navigation implementations that don't have just global stylesheet and global JavaScripts * At the same time, it is not possible to implement this simple scenario in the navigation area: "After clicking on any link in the menu, load the URL with XHR and from the loaded HTML, replace the content of elements #content and #sidebar and at the same time merge ". It is currently not possible to select multiple target elements to replace. OOB tries to replace this need, however, it requires a custom backend that returns OOB elements at the TOP level, which is also unusable for our use-cases. If HTMX is natively able to perform these scenarios as well, it will be fantastic and usable for other types of projects for which developers today are forced to use Unpoly, HotWire/Turbo or other libraries. At the same time, OOB rotates responsibility for this scenario. When I think about a specific link, at that moment, I know what should happen after clicking and which content I would like to replace, therefore I would like to include the selectors of the replaced elements in the attribute, not control it from the backend (HTML markup with OOB attributes). HTMX and its data attributes are now only designed to replace a single element, especially in the area of hx-target and hx-select attributes. Maybe replacing multiple elements could be implemented using hyperscript, but it would probably be weird. I think this functionality should be a native part of HTMX. So that it is not necessary to interfere with the behavior of hx-target and hx-select, perhaps it would be possible to add an attribute, e.g. hx-replace, where it would be possible to list more selectors for simple replacement in HTML? Do you know any disadvantages or risks of this solution?