-
In a .net 8 blazor static render solution enhanced navigation is turned on by default. This means only parts of the DOM are updated on a type navigation. After the navigation, htmx does not work on the page. If a refresh is done on the page, htmx works. Therefore, htmx from the navigation being performed with enhanced navigation is not hooked up. Is there a method in htmx to reload or re-register and hook things back up? This same issue happens when trying to use <script> in razor markup, and the solution from Microsoft is below. This provides a load/update/dispose option within javascript, and I used it to update bootstrap tooltips on the page after an enhanced navigation change. If there was an htmx load option, I have a place to make that call. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
Hey, so I'm not sure about your setup, but it looks like you want to use htmx.process here. If I understand correctly, you have DOM mutations happening in your page that aren't authored by htmx itself, and htmx doesn't work with those mutated elements right? |
Beta Was this translation helpful? Give feedback.
Hey, so I'm not sure about your setup, but it looks like you want to use htmx.process here.
If I understand correctly, you have DOM mutations happening in your page that aren't authored by htmx itself, and htmx doesn't work with those mutated elements right?
If that's the case, calling
htmx.process
on those new (or mutated) nodes will have htmx initialize them as you would expect!If that's not the case, well sorry I wouldn't have understood your issue then 😆