mirror of
https://github.com/lightpanda-io/browser.git
synced 2025-12-15 15:58:57 +00:00
handle key down for more input types
This commit is contained in:
@@ -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 });
|
||||||
|
|||||||
Reference in New Issue
Block a user