You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In some cases, we need to pass an attribute to a component using boolean style, i.e. without setting a value (such as empty), as is the case with things like wire:poll. A few days ago I noticed this:
Using like this:
<x-loadingwire:poll />
Generates this HTML:
<div...wire:poll="wire:poll">
Instead of:
<div...wire:poll>
Therefore, using things like wire:poll ends up generating: wire:poll="wire:poll" which ends up becoming a problem, even if a small one. There must certainly be several other cases where we need to pass attributes in this way, I'm just not remembering it now (besides, of course, things like required and disabled, where the value is optional)
Steps To Reproduce
Create a dummy component
Insert the {{ $attributes }} on this
Use the component passing a component attribute like wire:poll
Use your browser dev tools to check the final HTML generated: wire:poll="wire:poll"
The text was updated successfully, but these errors were encountered:
Yeah, I can reproduce this. Looks like this isn't supported at this time, sorry. I suggest you add a boolean check within the component itself to dynamically enable this. We'd appreciate a PR to maybe escape attributes like this so they're unaltered.
Laravel Version
11.3.0
PHP Version
8.3.4
Database Driver & Version
N/A
Description
In some cases, we need to pass an attribute to a component using boolean style, i.e. without setting a value (such as empty), as is the case with things like
wire:poll
. A few days ago I noticed this:Using like this:
Generates this HTML:
Instead of:
Therefore, using things like
wire:poll
ends up generating:wire:poll="wire:poll"
which ends up becoming a problem, even if a small one. There must certainly be several other cases where we need to pass attributes in this way, I'm just not remembering it now (besides, of course, things like required and disabled, where the value is optional)Steps To Reproduce
{{ $attributes }}
on thiswire:poll
wire:poll="wire:poll"
The text was updated successfully, but these errors were encountered: