creamy-dawn-16627
11/07/2022, 7:00 AMbillions-lion-37063
11/07/2022, 8:14 AMhx-boost
and targets another div in the page. Whenever a swap occurs, the page scrolls to the targeted div but away from the form. I want to prevent this scrolling so that the form remains in focus for the user to continue typing if desired. I read the documentation but I was unable to solve this. Any ideas? Thanks!billions-lion-37063
11/07/2022, 8:24 AMhx-swap="innerHTML focus-scroll:false"
but the page still scrolls.billions-lion-37063
11/07/2022, 8:40 AM<input>
directly as in this case I was able to. And the issue is resolved.mysterious-toddler-20573
11/07/2022, 11:56 AMfind
?melodic-advantage-28381
11/07/2022, 12:20 PMcreamy-dawn-16627
11/07/2022, 7:59 PMwhite-motorcycle-95262
11/07/2022, 8:00 PMform
or type="submit"
attributes (they have some hyperscript on them). Should HTMX be submitting the form when they get clicked? Cause it seems like that's what's happening. EDIT: The Request Header shows it's being boosted and the trigger was payment-form
)
<form
id="payment-form"
method="post"
action="{% url 'foo' %}"
hx-target="closest .card-body"
hx-swap="outerHTML"
>
EDIT: Adding type="button"
fixed it 🤷creamy-dawn-16627
11/07/2022, 8:03 PMmysterious-toddler-20573
11/07/2022, 8:04 PMcreamy-dawn-16627
11/07/2022, 8:05 PMmysterious-toddler-20573
11/07/2022, 8:05 PMprevious .commend-list
mysterious-toddler-20573
11/07/2022, 8:05 PMcreamy-dawn-16627
11/07/2022, 8:06 PMcreamy-dawn-16627
11/07/2022, 8:14 PMbillions-lion-37063
11/07/2022, 8:19 PMhundreds-camera-24900
11/08/2022, 12:10 AMhundreds-camera-24900
11/08/2022, 12:10 AMhundreds-camera-24900
11/08/2022, 12:24 AMhundreds-camera-24900
11/08/2022, 12:25 AMmysterious-toddler-20573
11/08/2022, 12:39 AMmysterious-toddler-20573
11/08/2022, 12:39 AMmysterious-toddler-20573
11/08/2022, 12:39 AMhundreds-camera-24900
11/08/2022, 1:25 AMhundreds-camera-24900
11/08/2022, 1:25 AMechoing-action-55459
11/08/2022, 3:14 AMmysterious-toddler-20573
11/08/2022, 2:09 PMmysterious-toddler-20573
11/08/2022, 2:09 PMrhythmic-hydrogen-92496
11/08/2022, 2:09 PMbillions-lion-37063
11/08/2022, 2:12 PM<form method="post" hx-boost="true" hx-trigger="keyup delay:300ms" hx-target="#results">
If I replace hx-boost
with hx-post=""
it works at intended i.e. no scrolling.