Aman-Mittal commented on issue #354:
URL: 
https://github.com/apache/fineract-backoffice-ui/issues/354#issuecomment-5303648599

   Your analysis holds — `aria-describedby` describes, it does not name, and 
setting it only while the tooltip is on screen means the button has no 
accessible name at the moment a screen reader user is deciding whether to press 
it. The 44 are real.
   
   My answer is the 44 attributes, and it is not about your having the branch 
written. It is this: `appTooltip` is on 255 hosts, and only 132 are 
`ion-button`. 108 are `ion-item`, and the rest are `ion-icon`, `ion-chip`, 
`ion-card-title`, `th`, `span`, `ion-searchbar`. So a directive that names its 
host would be doing name-management across 255 elements to fix 44, and would 
need guards to be a no-op on the other 211 — including not overriding the 
visible text on the `ion-item`s, which would break Label in Name and speech 
input, and not putting an `aria-label` on `th`/`span`/`ion-card-title`, where 
it has no role to attach to. A directive whose correctness depends on that many 
exclusions is not shared behaviour, it is a heuristic with a selector.
   
   The other half: the tooltip text is a description by construction. On these 
44 it happens to also be a good name (`COMMON.EDIT`, `LOANS.APPROVE`), but 
nothing keeps it that way — the moment someone puts a `HELP.*_DESC` on an 
icon-only button, the directive silently produces a sentence-long accessible 
name. `[attr.aria-label]` at the call site keeps name and description 
independently choosable, which is what they are.
   
   So: 44 `[attr.aria-label]` attributes, and please pair them with something 
that stops this regrowing — a unit test or lint rule that fails on an icon-only 
`ion-button` with no accessible name. That guard is the part that has lasting 
value, and it works regardless of what the directive does.
   
   Two notes for the PR:
   
   - `tooltip.directive.ts` has no spec, while `has-permission` and 
`has-institution-feature` both do. Not your issue to fix, but if you are in 
there anyway it would be welcome.
   - On these 44 the label and the description will be the same string, so a 
focused screen reader user hears it twice once the tooltip appears. I am fine 
with that; flagging it so it does not come up in review as a surprise.
   
   Sorry to send you back for the branch you already have. You asked the 
question the right way round.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to