fix: icon position for action group in header actions #11687
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 attempts to fix an issue where when using
iconPosition()
for anActionGroup
in thegetHeaderActions()
method of a custom page (in my case), it was not doing anything.I am not sure if the code I proposed here would be considered the "best" or "correct" way to do it, but I thought it would be nice for this to be able to be used.
It is worth noting that when using
iconPosition()
for anActionGroup
withiconButton()
, placing the:icon-position
prop in the view without the check I did results in the error "trim(): Argument #1 ($string) must be of type string, Filament\Support\Enums\IconPosition given
" coming from the<x-filament::icon-button>
component view, so maybe there is a better way to handle this.Example
Before
After
Code style
composer cs
command has been run.Testing