limited-potato-46306
12/23/2022, 8:50 PMimportant-cricket-63511
12/23/2022, 9:01 PM{childList: true subtree: true}
, 4/ every time there is some mutation in the DOM (triggered via MutationObserver), we check all of the watched elements to see if they're still in the DOM. If not, their callbacks get fired and the element is removed from the 'watched' list.
There might be a better way to do this, but I use this to clean up things like dialog elements that get appended to the root of the document (i want them automatically removed when the element that triggers the dialog gets removed)
Here's the code from my project (apologies, this is clojurescript code, but maybe you might find a useful bit in it)hundreds-cartoon-20446
12/23/2022, 9:05 PMhundreds-cartoon-20446
12/23/2022, 9:16 PMabundant-intern-86613
12/23/2022, 10:19 PMmysterious-toddler-20573
12/23/2022, 11:27 PMdatalist
elements, like this:
https://codepen.io/1cg/pen/LYBVaxJ?editors=1001
but safari doesn't update properlymammoth-family-48524
12/24/2022, 2:07 AMmysterious-toddler-20573
12/24/2022, 2:47 AMmysterious-toddler-20573
12/24/2022, 2:48 AMhtmx:beforeCleanupElement
event that is triggered on the entire tree of removed dom elements, which is a perf issuemysterious-toddler-20573
12/24/2022, 2:51 AMmysterious-toddler-20573
12/24/2022, 2:51 AMthankful-ice-8687
12/24/2022, 4:55 AMabundant-intern-86613
12/24/2022, 8:41 AMfreezing-controller-74032
12/24/2022, 8:42 AMjavascript
_="on click add [@disabled] until htmx:afterOnLoad"
This command seems to block the button until a response is received, but for some reason it does not work.
Help block buttons and rename it
What do I want to do
There is a form that sends hx-post request.
I want to make it so that when you click on the submit button, the name of the button (Submit data) changes to (Data is being sent ...) and the button is blocked
After the response is received, return the name of the button (Submit data) and make the button activeabundant-intern-86613
12/24/2022, 8:51 AMabundant-intern-86613
12/24/2022, 8:56 AMfreezing-controller-74032
12/24/2022, 9:02 AMabundant-intern-86613
12/24/2022, 9:03 AMabundant-intern-86613
12/24/2022, 9:06 AMfreezing-controller-74032
12/24/2022, 9:06 AMabundant-intern-86613
12/24/2022, 9:06 AMabundant-intern-86613
12/24/2022, 9:11 AMfreezing-controller-74032
12/24/2022, 9:14 AMabundant-intern-86613
12/24/2022, 9:21 AMfreezing-controller-74032
12/24/2022, 9:35 AMabundant-intern-86613
12/24/2022, 1:57 PMmammoth-family-48524
12/24/2022, 9:16 PMripe-action-67367
12/25/2022, 8:59 AMmysterious-toddler-20573
12/25/2022, 4:29 PM