use initTrusted for InputEvent

This commit is contained in:
Pierre Tachoire
2026-03-18 16:39:59 +01:00
parent bf6e4cf3a6
commit 4e6a357e6e
2 changed files with 2 additions and 2 deletions

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());
}

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());
}