-
Hi all I am trying to update a button with an oob response.
The response includes (among other HTML):
but after the swap the "button" looks like this: Also tried without the DIV:
and with a response including:
there is no change at all. Any help is appreciated. Thanks, |
Beta Was this translation helpful? Give feedback.
Replies: 6 comments
-
Maybe this happens because the only difference in the HTML code is the disabled="disabled" part |
Beta Was this translation helpful? Give feedback.
-
Removed the oob swap from the response and added JS instead to enable/disable the button:
|
Beta Was this translation helpful? Give feedback.
-
<div id="logbtn" hx-swap-oob="outerHTML"> <!-- note the hx-swap-oob -->
<button class="button is-info is-light" type="button" hx-get="/scanpak/scanlog"
hx-target="#themsg" hx-swap="outerHTML">Scan Log <!-- no hx-swap-oob on this! -->
</button>
</div> |
Beta Was this translation helpful? Give feedback.
-
Thank you!
which is kinda weird because |
Beta Was this translation helpful? Give feedback.
-
After a bit more testing, it works with |
Beta Was this translation helpful? Give feedback.
-
"true" can not be combined with other hx-swap values |
Beta Was this translation helpful? Give feedback.
hx-swap-oob
should go on the tag being swapped into that position -- in your case, thediv#logbtn
. This response should work: