use initTrusted for InputEvent

This commit is contained in:
Pierre Tachoire committed 2026-03-18 16:41:28 +01:00
1 parent bf6e4cf3a6
commit 4e6a357e6e
2 files changed
+2 -2

No files matched your search

+1 -1
View File
@@ -105,7 +105,7 @@ fn dispatchSelectionChangeEvent(self: *Input, page: *Page) !void {
}
fn dispatchInputEvent(self: *Input, data: ?[]const u8, input_type: []const u8, page: *Page) !void {
const event = try InputEvent.init("input", .{ .data = data, .inputType = input_type }, page);
const event = try InputEvent.initTrusted(comptime .wrap("input"), .{ .data = data, .inputType = input_type }, page);
try page._event_manager.dispatch(self.asElement().asEventTarget(), event.asEvent());
}
+1 -1
View File
@@ -57,7 +57,7 @@ fn dispatchSelectionChangeEvent(self: *TextArea, page: *Page) !void {
}
fn dispatchInputEvent(self: *TextArea, data: ?[]const u8, input_type: []const u8, page: *Page) !void {
const event = try InputEvent.init("input", .{ .data = data, .inputType = input_type }, page);
const event = try InputEvent.initTrusted(comptime .wrap("input"), .{ .data = data, .inputType = input_type }, page);
try page._event_manager.dispatch(self.asElement().asEventTarget(), event.asEvent());
}