feat: Updating id key for usage in views, for typesafe keys

This commit is contained in:
2025-01-19 20:07:32 -05:00
parent 81f0e03549
commit 2de85ed758
13 changed files with 203 additions and 119 deletions

View File

@@ -24,10 +24,14 @@ struct UserForm: HTML, Sendable {
.hx.pushURL(context.pushURL),
.hx.target(context.target),
.hx.swap(.outerHTML),
.custom(
name: "hx-on::after-request",
value: "if(event.detail.successful) this.reset(); toggleContent('float');"
.hx.on(
.afterRequest,
.ifSuccessful(.resetForm, .toggleContent(.float))
)
// .custom(
// name: "hx-on::after-request",
// value: "if(event.detail.successful) this.reset(); toggleContent('float');"
// )
) {
if case let .login(next) = context, let next {
input(.type(.hidden), .name("next"), .value(next))
@@ -46,9 +50,7 @@ struct UserForm: HTML, Sendable {
if context.showConfirmPassword {
div(.class("row")) {
input(
.type(.password),
.id("confirmPassword"),
.name("confirmPassword"),
.type(.password), .id("confirmPassword"), .name("confirmPassword"),
.placeholder("Confirm Password"),
.required
)