Replies: 1 comment 6 replies
-
|
Hey, it's weird that the Could you show your HTML code for Other than that, could you try adding a log of Hope this helps! |
Beta Was this translation helpful? Give feedback.
-
|
Hey, it's weird that the Could you show your HTML code for Other than that, could you try adding a log of Hope this helps! |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
I am working on an "active search" demo with a loading indicator. And, to make sure the loading indicator works, I've added a 2-second delay to my search results. However, I'm seeing a strange issue in which:
hx-push-urlfrom the search page updates the browser location even though that UI is no longer rendered.To get around this, I've tried to trigger an
htmx:abortevent on the active search input when the element unloads; but, it doesn't seem to actually do anything. Here's my input code. Three things to note:hx-syncon the form (to synchronize the active search and the form submission).hx-push-url="true"on the active search input.hx-on:htmx:before-cleanup-elementon the input.I can see from the
console.log("here")that thebefore-cleanup-elementevent is being fired. However, I can see from the browser network activity that the pending request isn't being aborted; which is why, I presume, I'm seeing the active search URL get pushed onto the history even after I've navigated away.I feel like I must be missing something very subtle. Not sure if the
hx-syncis messing things up. Or, if maybe the AJAX queue is no longer bound to the element at the time thebefore-cleanup-elementevent is fired. Thanks for any advice!Beta Was this translation helpful? Give feedback.
All reactions