handle key down for more input types

This commit is contained in:
Pierre Tachoire
2025-11-24 10:05:51 +01:00
parent 9881a4d288
commit b0d9ebaf3a

View File

@@ -1031,11 +1031,16 @@ pub const Page = struct {
return self.submitForm(@ptrCast(form), null); return self.submitForm(@ptrCast(form), null);
} }
if (std.mem.eql(u8, input_type, "text")) { if (std.mem.eql(u8, input_type, "radio")) {
const value = try parser.inputGetValue(@ptrCast(element)); return;
const new_value = try std.mem.concat(self.arena, u8, &.{ value, new_key });
try parser.inputSetValue(@ptrCast(element), new_value);
} }
if (std.mem.eql(u8, input_type, "checkbox")) {
return;
}
const value = try parser.inputGetValue(@ptrCast(element));
const new_value = try std.mem.concat(self.arena, u8, &.{ value, new_key });
try parser.inputSetValue(@ptrCast(element), new_value);
}, },
.textarea => { .textarea => {
log.debug(.input, "key down on textarea", .{ .tag = tag, .key = new_key }); log.debug(.input, "key down on textarea", .{ .tag = tag, .key = new_key });