Skip to content

Commit b0d9eba

Browse files
committed
handle key down for more input types
1 parent 9881a4d commit b0d9eba

File tree

1 file changed

+9
-4
lines changed

1 file changed

+9
-4
lines changed

src/browser/page.zig

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1031,11 +1031,16 @@ pub const Page = struct {
10311031
return self.submitForm(@ptrCast(form), null);
10321032
}
10331033

1034-
if (std.mem.eql(u8, input_type, "text")) {
1035-
const value = try parser.inputGetValue(@ptrCast(element));
1036-
const new_value = try std.mem.concat(self.arena, u8, &.{ value, new_key });
1037-
try parser.inputSetValue(@ptrCast(element), new_value);
1034+
if (std.mem.eql(u8, input_type, "radio")) {
1035+
return;
10381036
}
1037+
if (std.mem.eql(u8, input_type, "checkbox")) {
1038+
return;
1039+
}
1040+
1041+
const value = try parser.inputGetValue(@ptrCast(element));
1042+
const new_value = try std.mem.concat(self.arena, u8, &.{ value, new_key });
1043+
try parser.inputSetValue(@ptrCast(element), new_value);
10391044
},
10401045
.textarea => {
10411046
log.debug(.input, "key down on textarea", .{ .tag = tag, .key = new_key });

0 commit comments

Comments
 (0)