* Triggers a custom or built-in event.
*/
function triggerEvent(element, eventName) {
+ if (eventName === "click" && element instanceof HTMLElement) {
+ element.click();
+ return;
+ }
const event = new Event(eventName, {
bubbles: true,
cancelable: true,
* Triggers a custom or built-in event.
*/
export function triggerEvent(element: EventTarget, eventName: string): void {
+ if (eventName === "click" && element instanceof HTMLElement) {
+ element.click();
+ return;
+ }
+
const event = new Event(eventName, {
bubbles: true,
cancelable: true,