-
Notifications
You must be signed in to change notification settings - Fork 11.6k
Closed
Description
Laravel Version
11.37.0
PHP Version
8.2.15
Database Driver & Version
MariaDB 10.11.1 on macOS Intel
Description
When defining an anonymous component with parent accessor using @aware
directive, we can override the parent attribute by passing the value in child component.
However, that attribute is not removed from the $attributes list.
Ideally, all attributes defined in the @aware
directive should be removed from $attributes
alongwith the attributes defined in @props
Steps To Reproduce
Using the example from Documentation - Blade#accessing-parent-data
This code:
<x-menu color="purple">
<x-menu.item>...</x-menu.item>
<x-menu.item color="red">...</x-menu.item>
</x-menu>
generates the following html (formatted for clarity)
<ul class="bg-purple-200">
<li class="text-purple-800">...</li>
<li class="text-red-800" color="red">...</li>
</ul>
As we can see, color="red"
remains in the attribute list for second list item.
Only way to remove it from the attribute list is to define @props
directive along with @aware
, which seems redundant.
Metadata
Metadata
Assignees
Labels
No labels