F
Filament15mo ago
awsqed

Single/double quote is encoded when using extraAttributes

I'm following the doc: https://filamentphp.com/docs/3.x/widgets/stats-overview#adding-extra-html-attributes-to-a-stat But it results in quote is being encode instead of what I expect. Code
return $action->extraAttributes([
'x-on:click.stop' => "\$dispatch('next-wizard-step', {statePath: 'data'})"
], true);
return $action->extraAttributes([
'x-on:click.stop' => "\$dispatch('next-wizard-step', {statePath: 'data'})"
], true);
Expectation
x-on:click.stop="$dispatch('next-wizard-step', {statePath: 'data'})"
x-on:click.stop="$dispatch('next-wizard-step', {statePath: 'data'})"
Actual
x-on:click.stop="$dispatch('next-wizard-step', {statePath: 'data'})"
x-on:click.stop="$dispatch('next-wizard-step', {statePath: 'data'})"
Solution:
try new HtmlString("...")
Jump to solution
3 Replies
mxc
mxc14mo ago
I also have this issue. Did you find a solution?
Solution
LeandroFerreira
LeandroFerreira14mo ago
try new HtmlString("...")
mxc
mxc14mo ago
Thanks will give it a try.

Did you find this page helpful?