@@ -864,7 +864,7 @@ export const vnode_diff = (
864864 const recordJsxEvent = ( key : string , value : any ) => {
865865 const data = getEventDataFromHtmlAttribute ( key ) ;
866866 if ( data ) {
867- const [ eventName , scope ] = data ;
867+ const [ scope , eventName ] = data ;
868868 record ( ':' + scope + ':' + eventName , value ) ;
869869 // register an event for qwik loader
870870 registerQwikLoaderEvent ( eventName ) ;
@@ -908,10 +908,18 @@ export const vnode_diff = (
908908 // Keys match: update if values differ
909909 const srcValue = srcAttrs [ srcIdx + 1 ] ;
910910 const dstValue = dstAttrs [ dstIdx + 1 ] ;
911+ const isEventHandler = isHtmlAttributeAnEventName ( srcKey ) ;
911912 if ( srcValue !== dstValue ) {
912- record ( srcKey , srcValue ) ;
913- // Update in place doesn't change array length
913+ if ( isEventHandler ) {
914+ recordJsxEvent ( srcKey , srcValue ) ;
915+ } else {
916+ record ( srcKey , srcValue ) ;
917+ }
918+ } else if ( isEventHandler && ! vnode . element . qDispatchEvent ) {
919+ // Special case: add event handlers after resume
920+ recordJsxEvent ( srcKey , srcValue ) ;
914921 }
922+ // Update in place doesn't change array length
915923 srcIdx += 2 ; // skip key and value
916924 dstIdx += 2 ; // skip key and value
917925 } else if ( srcKey < dstKey ) {
0 commit comments