-
-
Notifications
You must be signed in to change notification settings - Fork 148
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
"defer" attribute fails #194
Comments
This seems to bypass it, but it's redundant {!! Blade::render(Blade::render(" {{ svg('o-home', 'method-X-times-render', ['defer' => true]) }} ")) !!} |
This feature was added by @indykoning. Right now, I have no plans on providing support myself for this feature but would appreciate it if either @indykoning could look into this or if someone can send in a PR. Thanks |
It seems that any escape/print texts are compiled later in the process thus not triggering the blade engine to actually compile the @once and @Push statements to php code. What this boils down to is that it is not possible to directly print out the defered icons i'm afraid. Three possible fixes in usage of it are using <x-icon-o-home defer/> 2: {!! Blade::render(svg('o-home', 'method-A', ['defer'])->toHtml()) !!} As this tells blade to render the html result of the svg function, thus compiling the php code. 3: We cannot tell the helper function to compile the output of the svg class itself as we don't know if it is rendered in blade. |
Gonna revisit this as I want to see this solved. I haven't dug deep into this yet so would appreciate any help here. I'm not sure extending Blade is the right solution. |
Library version
v1.3.0
Laravel version
v9.18.0
PHP version
v8.1.7
Description
defer
it's not working as expected with the helper function. I have the components deactivated, but even activated it fails. And the sets enabled too.Steps to reproduce
Method 1
outputs
Method 2
outputs
The text was updated successfully, but these errors were encountered: