Skip to content

fix: Do not override HTML attribute title if already set for Action…#6872

Merged
javiereguiluz merged 1 commit intoEasyCorp:4.xfrom
jbonnier:4.x
May 7, 2025
Merged

fix: Do not override HTML attribute title if already set for Action…#6872
javiereguiluz merged 1 commit intoEasyCorp:4.xfrom
jbonnier:4.x

Conversation

@jbonnier
Copy link
Copy Markdown
Contributor

@jbonnier jbonnier commented Mar 19, 2025

If an action has no label but has the HTML attribute already set, it should not be replaced by the action name.

Use case example:

$moveDown = Action::new('moveDown', false, 'fa fa-angle-down')
    ->setHtmlAttributes(['title' => $this->trans('Move Down')])
    ->linkToCrudAction('moveDown')
    ->displayIf(static fn(SortableEntityInterface $entity): bool => $entity->getPosition() < $entityCount - 1)
;

Copy link
Copy Markdown
Contributor

@chapterjason chapterjason left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM :)

@javiereguiluz javiereguiluz added this to the 4.x milestone May 7, 2025
@javiereguiluz javiereguiluz merged commit 950b6c8 into EasyCorp:4.x May 7, 2025
12 checks passed
@javiereguiluz
Copy link
Copy Markdown
Collaborator

Makes sense. Merged! Thanks @jbonnier

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants