diff --git a/src/runtime/internal/dom.ts b/src/runtime/internal/dom.ts index 8d99234c9d..0cf3c813b9 100644 --- a/src/runtime/internal/dom.ts +++ b/src/runtime/internal/dom.ts @@ -85,6 +85,13 @@ export function self(fn) { }; } +export function trusted(fn) { + return function(event) { + // @ts-ignore + if (event.isTrusted) fn.call(this, event); + }; +} + export function attr(node: Element, attribute: string, value?: string) { if (value == null) node.removeAttribute(attribute); else if (node.getAttribute(attribute) !== value) node.setAttribute(attribute, value);