File tree Expand file tree Collapse file tree 1 file changed +8
-1
lines changed
packages/core/src/hydration Expand file tree Collapse file tree 1 file changed +8
-1
lines changed Original file line number Diff line number Diff line change @@ -36,6 +36,7 @@ declare global {
36
36
}
37
37
38
38
const JSACTION_ATTRIBUTE = 'jsaction' ;
39
+ const removeJsactionQueue : RElement [ ] = [ ] ;
39
40
40
41
/**
41
42
* Returns a set of providers required to setup support for event replay.
@@ -52,7 +53,9 @@ export function withEventReplay(): Provider[] {
52
53
useValue : ( ) => {
53
54
setDisableEventReplayImpl ( ( el : RElement ) => {
54
55
if ( el . hasAttribute ( JSACTION_ATTRIBUTE ) ) {
55
- el . removeAttribute ( JSACTION_ATTRIBUTE ) ;
56
+ // We don't immediately remove the attribute here because
57
+ // we need it for replay that happens after hydration.
58
+ removeJsactionQueue . push ( el ) ;
56
59
}
57
60
} ) ;
58
61
} ,
@@ -79,6 +82,10 @@ export function withEventReplay(): Provider[] {
79
82
setEventReplayer ( dispatcher ) ;
80
83
// Event replay is kicked off as a side-effect of executing this function.
81
84
registerDispatcher ( eventContract , dispatcher ) ;
85
+ for ( const el of removeJsactionQueue ) {
86
+ el . removeAttribute ( JSACTION_ATTRIBUTE ) ;
87
+ }
88
+ removeJsactionQueue . length = 0 ;
82
89
}
83
90
} ) ;
84
91
} ;
You can’t perform that action at this time.
0 commit comments