Use HX-Target, not HX-Boost for Layout render
HX-Boost is not always sent in all AJAX requests that htmx sends, only those initiated by an element with hx-boost enabled. It was not showing up on requests following an HX-Redirect response. After reading the docs more, I realized HX-Target was what I wanted. If I can see that the request is targeting `#main-content` then I know to only return HTML inside that element. Simple.
This commit is contained in:
@@ -16,7 +16,7 @@ pub fn login_form(props: LoginFormProps) -> Markup {
|
||||
general_error,
|
||||
} = props;
|
||||
html! {
|
||||
form hx-post="/login" hx-swap="outerHTML" class="auth-form-grid" {
|
||||
form action="/login" method="post" class="auth-form-grid" {
|
||||
label for="email" { "Email" }
|
||||
input type="email" name="email" id="email" placeholder="Email" value=(email.unwrap_or_default()) required;
|
||||
@if let Some(email_error) = email_error {
|
||||
|
||||
Reference in New Issue
Block a user