mirror of
https://github.com/lightpanda-io/browser.git
synced 2026-03-22 04:34:44 +00:00
use initTrusted for InputEvent
This commit is contained in:
@@ -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 {
|
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());
|
try page._event_manager.dispatch(self.asElement().asEventTarget(), event.asEvent());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -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 {
|
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());
|
try page._event_manager.dispatch(self.asElement().asEventTarget(), event.asEvent());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user