Skip to content

oob button not swapping correctly #698

Answered by dz4k
denesl asked this question in Q&A
Discussion options

You must be logged in to vote

hx-swap-oob should go on the tag being swapped into that position -- in your case, the div#logbtn. This response should work:

<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>

Replies: 6 comments

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Answer selected by denesl
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants