File tree Expand file tree Collapse file tree 3 files changed +9
-14
lines changed Expand file tree Collapse file tree 3 files changed +9
-14
lines changed Original file line number Diff line number Diff line change @@ -26,10 +26,10 @@ import { ChoreType } from '../shared/util-chore-type';
2626import { escapeHTML } from '../shared/utils/character-escaping' ;
2727import { _OWNER } from '../shared/utils/constants' ;
2828import {
29+ fromCamelToKebabCase ,
2930 getEventDataFromHtmlAttribute ,
3031 isHtmlAttributeAnEventName ,
3132 isJsxPropertyAnEventName ,
32- jsxEventToEventName ,
3333} from '../shared/utils/event-names' ;
3434import { getFileLocationFromJsx } from '../shared/utils/jsx-filename' ;
3535import {
@@ -765,7 +765,7 @@ export const vnode_diff = (
765765 // Event handler needs to be patched onto the element.
766766 if ( ! element . qDispatchEvent ) {
767767 element . qDispatchEvent = ( event : Event , scope : QwikLoaderEventScope ) => {
768- const eventName = jsxEventToEventName ( event . type , 0 , event . type . length ) ;
768+ const eventName = fromCamelToKebabCase ( event . type ) ;
769769 const eventProp = ':' + scope . substring ( 1 ) + ':' + eventName ;
770770 const qrls = [
771771 vNode . getProp < QRL > ( eventProp , null ) ,
Original file line number Diff line number Diff line change @@ -8,12 +8,7 @@ import type {
88} from '../shared/jsx/types/jsx-qwik-attributes' ;
99import type { HostElement } from '../shared/types' ;
1010import { USE_ON_LOCAL , USE_ON_LOCAL_FLAGS , USE_ON_LOCAL_SEQ_IDX } from '../shared/utils/markers' ;
11- import {
12- DOM_CONTENT_LOADED_EVENT ,
13- EventNameHtmlScope ,
14- createEventName ,
15- type EventNameJSXScope ,
16- } from '../shared/utils/event-names' ;
11+ import { EventNameHtmlScope , createEventName } from '../shared/utils/event-names' ;
1712
1813export type EventQRL < T extends string = AllEventKeys > =
1914 | QRL < EventHandler < EventFromName < T > , Element > >
Original file line number Diff line number Diff line change @@ -3,11 +3,7 @@ import type { ClientContainer } from '@qwik.dev/core/internal';
33import { vi } from 'vitest' ;
44import { assertDefined } from '../core/shared/error/assert' ;
55import type { Container , QElement , QwikLoaderEventScope } from '../core/shared/types' ;
6- import {
7- EventNameHtmlScope ,
8- EventNameJSXScope ,
9- fromCamelToKebabCase ,
10- } from '../core/shared/utils/event-names' ;
6+ import { EventNameHtmlScope , fromCamelToKebabCase } from '../core/shared/utils/event-names' ;
117import { QFuncsPrefix , QInstanceAttr } from '../core/shared/utils/markers' ;
128import { delay } from '../core/shared/utils/promises' ;
139import { invokeApply , newInvokeContextFromTuple } from '../core/use/use-core' ;
@@ -120,7 +116,11 @@ export async function trigger(
120116 cancelable : true ,
121117 } ) ;
122118 Object . assign ( event , eventPayload ) ;
123- const prefix = scope ? EventNameJSXScope . on + scope + ':' : EventNameHtmlScope . on ;
119+ const prefix = scope
120+ ? scope === '-document'
121+ ? EventNameHtmlScope . document
122+ : EventNameHtmlScope . window
123+ : EventNameHtmlScope . on ;
124124 const attrName = prefix + fromCamelToKebabCase ( eventName ) ;
125125 await dispatch ( element , attrName , event , scope ) ;
126126 }
You can’t perform that action at this time.
0 commit comments