Fixed icon not rotated and simplified component #15350
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
This PR builds on #15327 and simplifies the icon component by relying on the behavior of rendering
{{ $attributes }}
within a component. This allows any native html attributes to be rendered on the component by passing them in (<x-icon something="here"
) and utilizing the{{ $attributes }}
that is already rendered in the component.The removal of
id
from theprops
is especially helpful since it allows it to be rendered when$attributes
is used within the component and fixes an issue where a couple icons weren't rotating any more sinceid
was no longer being added:In other words, by including
id
inprops
we would have had to manually write{{ $id }}
within the component'si
tag to get it to render.Another potential (minor) change would be to not set a default value for
title
inprops
since it should always be passed in but I'll skip that in this PR to avoid re-testing all views.Type of change