Skip to content

Commit daa2fea

Browse files
committed
Minor tweak
1 parent 950b6c8 commit daa2fea

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

src/Factory/ActionFactory.php

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -157,10 +157,12 @@ private function processAction(string $pageName, ActionDto $actionDto, ?EntityDt
157157
private function processActionLabel(ActionDto $actionDto, ?EntityDto $entityDto, string $translationDomain, array $defaultTranslationParameters): void
158158
{
159159
$label = $actionDto->getLabel();
160-
$title = $actionDto->getHtmlAttributes()['title'] ?? '';
160+
$htmlTitle = trim($actionDto->getHtmlAttributes()['title'] ?? '');
161161

162-
// FALSE means that action doesn't show a visible label in the interface
163-
if (false === $label && '' === trim($title)) {
162+
// FALSE means that action doesn't show a visible label in the interface;
163+
// add an HTML 'title' attribute (unless the user defined one explicitly) to
164+
// improve accessibility and show the action name on mouse hover
165+
if (false === $label && '' === $htmlTitle) {
164166
$actionDto->setHtmlAttribute('title', $actionDto->getName());
165167

166168
return;

0 commit comments

Comments
 (0)