Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

matTooltip on mat-header-cell adds aria-describedby which is not removed when tooltip becomes null #17070

Closed
stevendarby opened this issue Sep 12, 2019 · 1 comment · Fixed by #17074
Assignees
Labels
P3 An issue that is relevant to core functions, but does not impede progress. Important, but not urgent

Comments

@stevendarby
Copy link

Reproduction

Use StackBlitz to reproduce your issue: https://stackblitz.com/edit/angular-7rtgt9

Steps to reproduce:

  1. Add a matTooltip to a header cell and bind it so that it returns null if no rows are selected, or 'x selected' if there are some rows selected.
  2. Note that initially, before any rows are selected, there is no aria-describedby attribute on the header cell.
  3. Select all rows so the tooltip is now bound to the 'x selected' message.
  4. Note that the tooltip, now in action, also creates an aria-describedby attribute and its value is the name of an element with the tooltip's message.
  5. Deselect all rows so the tooltip is bound to null again.

Expected Behavior

I would expect to see the aria-describedby attribute removed from the header cell

Actual Behavior

The aria-describedby attribute remains, with no value. This can cause issues for accessibility.

Environment

  • Angular: 8.1.4
  • CDK/Material: 8.1.4
  • Browser(s): Chrome 77.0.3865.75 (Official Build) (64-bit)
  • Operating System (e.g. Windows, macOS, Ubuntu): Windows 10
@crisbeto crisbeto self-assigned this Sep 13, 2019
@crisbeto crisbeto added has pr P3 An issue that is relevant to core functions, but does not impede progress. Important, but not urgent labels Sep 13, 2019
crisbeto added a commit to crisbeto/material2 that referenced this issue Sep 13, 2019
… left

Currently the `AriaDescriber` will leave an empty `aria-describedby` attribute once all of the descriptions have been removed. These changes remove the attribute completely in order to avoid potential a11y issues.

Fixes angular#17070.
crisbeto added a commit to crisbeto/material2 that referenced this issue Sep 13, 2019
… left

Currently the `AriaDescriber` will leave an empty `aria-describedby` attribute once all of the descriptions have been removed. These changes remove the attribute completely in order to avoid potential a11y issues.

Fixes angular#17070.
crisbeto added a commit to crisbeto/material2 that referenced this issue Sep 13, 2019
… left

Currently the `AriaDescriber` will leave an empty `aria-describedby` attribute once all of the descriptions have been removed. These changes remove the attribute completely in order to avoid potential a11y issues.

Fixes angular#17070.
jelbourn pushed a commit that referenced this issue Sep 18, 2019
… are left (#17074)

Currently the `AriaDescriber` will leave an empty `aria-describedby` attribute once all of the descriptions have been removed. These changes remove the attribute completely in order to avoid potential a11y issues.

Fixes #17070.
jelbourn pushed a commit to jelbourn/components that referenced this issue Sep 24, 2019
… are left (angular#17074)

Currently the `AriaDescriber` will leave an empty `aria-describedby` attribute once all of the descriptions have been removed. These changes remove the attribute completely in order to avoid potential a11y issues.

Fixes angular#17070.

(cherry picked from commit e66de46)
@angular-automatic-lock-bot
Copy link

This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.

@angular-automatic-lock-bot angular-automatic-lock-bot bot locked and limited conversation to collaborators Oct 19, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
P3 An issue that is relevant to core functions, but does not impede progress. Important, but not urgent
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants