-
Notifications
You must be signed in to change notification settings - Fork 11.2k
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
Using @aware does not remove attributes from $attributes #54276
Comments
Hey there, thanks for reporting this issue. We'll need more info and/or code to debug this further. Can you please create a repository with the command below, commit the code that reproduces the issue as one separate commit on the main/master branch and share the repository here? Please make sure that you have the latest version of the Laravel installer in order to run this command. Please also make sure you have both Git & the GitHub CLI tool properly set up.
Do not amend and create a separate commit with your custom changes. After you've posted the repository, we'll try to reproduce the issue. Thanks! |
https://github.com/adwiv/laravel-bug-report-54276 <!-- View file -->
<x-menu color="purple">
<x-menu.item>Home</x-menu.item>
<x-menu.item color="red">About</x-menu.item>
</x-menu> <!-- Expected output -->
<ul class="bg-purple-200">
<li class="text-purple-800">Home</li>
<li class="text-red-800">About</li>
</ul> <!-- Actual output -->
<ul class="bg-purple-200">
<li class="text-purple-800">Home</li>
<li class="text-red-800" color="red">About</li>
</ul> Issue Description: Current Workaround: Expected Behavior: |
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:
generates the following html (formatted for clarity)
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.The text was updated successfully, but these errors were encountered: