File tree Expand file tree Collapse file tree 1 file changed +4
-8
lines changed
src/LiveComponent/src/EventListener Expand file tree Collapse file tree 1 file changed +4
-8
lines changed Original file line number Diff line number Diff line change @@ -74,14 +74,10 @@ public function onPreRender(PreRenderEvent $event): void
74
74
);
75
75
}
76
76
77
- $ hasLiveId = isset ($ originalAttributes ['data-live-id ' ]);
78
- $ isDeferred = \array_key_exists ('defer ' , $ originalAttributes );
79
- $ loadingTemplate = $ originalAttributes ['defer-loading-template ' ] ?? null ;
80
-
81
- // if the original attributes has a data-live-id, it means the component
82
- // was already rendered
83
- if (!$ hasLiveId && $ isDeferred ) {
84
- $ attributes = $ attributes ->without ('defer ' , 'defer-loading-template ' );
77
+ $ inputProps = $ event ->getMountedComponent ()->getInputProps ();
78
+ $ isDeferred = array_key_exists ('defer ' , $ inputProps );
79
+
80
+ if ($ isDeferred ) {
85
81
$ event ->setTemplate ('@LiveComponent/deferred.html.twig ' );
86
82
87
83
if ($ loadingTemplate ) {
You can’t perform that action at this time.
0 commit comments