Skip to content

bug(material/list): can tab to a disabled list when selecting an item before disabling it #25730

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

Closed
1 task
zarend opened this issue Sep 30, 2022 · 1 comment
Closed
1 task
Assignees
Labels
Accessibility This issue is related to accessibility (a11y) area: material/list P3 An issue that is relevant to core functions, but does not impede progress. Important, but not urgent

Comments

@zarend
Copy link
Contributor

zarend commented Sep 30, 2022

Is this a regression?

  • Yes, this behavior used to work in the previous version

The previous version in which this bug was not present was

No response

Description

Selecting an item in a list, then disabling the list leaves the selected item in the tab order. Should never be able to tab to the list after disabling it.

Reproduction

Steps to reproduce:

  1. Open "https://material2-dev.web.app/list"
  2. Navigate to "Selection list"
  3. (Notice options "Bananas, Oranges, etc.")
  4. Click "Bananas"
  5. Click "Disable Selection List"
  6. Press shift + tab twice

Expected Behavior

Focus is not on the "Selection list"

Actual Behavior

Focus is on the "Selection list"
image

Environment

  • Angular:
  • CDK/Material:
  • Browser(s):
  • Operating System (e.g. Windows, macOS, Ubuntu):
@zarend zarend added P3 An issue that is relevant to core functions, but does not impede progress. Important, but not urgent Accessibility This issue is related to accessibility (a11y) area: material/list labels Sep 30, 2022
@zarend zarend self-assigned this Sep 30, 2022
zarend added a commit to zarend/components that referenced this issue Sep 30, 2022
…bled

Remove list options from the tab order when the entire slection list is
disabled. Fix accessibility issue where end user can tab to a disabled selection
list.

```
<mat-selection-list disabled>
  <mat-list-option>A</mat-list-option>
  <!-- ^ should have tabindex="-1" since entire list is disabled -->
</mat-selection-list>
```

Approach is to consider a disabled mat-selection-list with a mat-list-option
having `tabindex="0"` an invalid state. When disabled Input on the seleciton
list is set to true, set tabindex to -1 on every list option.

fixes angular#25730
zarend added a commit to zarend/components that referenced this issue Sep 30, 2022
…bled

Remove list options from the tab order when the entire slection list is
disabled. Fix accessibility issue where end user can tab to a disabled selection
list.

```
<mat-selection-list disabled>
  <mat-list-option>A</mat-list-option>
  <!-- ^ should have tabindex="-1" since entire list is disabled -->
</mat-selection-list>
```

Approach is to consider a disabled mat-selection-list with a mat-list-option
having `tabindex="0"` an invalid state. When disabled Input on the seleciton
list is set to true, set tabindex to -1 on every list option.

fixes angular#25730
zarend added a commit to zarend/components that referenced this issue Oct 5, 2022
…bled

Remove list options from the tab order when the entire slection list is
disabled. Fix accessibility issue where end user can tab to a disabled selection
list.

```
<mat-selection-list disabled>
  <mat-list-option>A</mat-list-option>
  <!-- ^ should have tabindex="-1" since entire list is disabled -->
</mat-selection-list>
```

Approach is to consider a disabled mat-selection-list with a mat-list-option
having `tabindex="0"` an invalid state. When disabled Input on the seleciton
list is set to true, set tabindex to -1 on every list option.

fixes angular#25730
zarend added a commit to zarend/components that referenced this issue Oct 6, 2022
…bled

Remove list options from the tab order when the entire slection list is
disabled. Fix accessibility issue where end user can tab to a disabled selection
list.

```
<mat-selection-list disabled>
  <mat-list-option>A</mat-list-option>
  <!-- ^ should have tabindex="-1" since entire list is disabled -->
</mat-selection-list>
```

Approach is to consider a disabled mat-selection-list with a mat-list-option
having `tabindex="0"` an invalid state. When disabled Input on the seleciton
list is set to true, set tabindex to -1 on every list option.

fixes angular#25730
zarend added a commit to zarend/components that referenced this issue Oct 6, 2022
…bled

Remove list options from the tab order when the entire slection list is
disabled. Fix accessibility issue where end user can tab to a disabled selection
list.

```
<mat-selection-list disabled>
  <mat-list-option>A</mat-list-option>
  <!-- ^ should have tabindex="-1" since entire list is disabled -->
</mat-selection-list>
```

Approach is to consider a disabled mat-selection-list with a mat-list-option
having `tabindex="0"` an invalid state. When disabled Input on the seleciton
list is set to true, set tabindex to -1 on every list option.

fixes angular#25730
zarend added a commit to zarend/components that referenced this issue Oct 11, 2022
…bled

Remove list options from the tab order when the entire slection list is
disabled. Fix accessibility issue where end user can tab to a disabled selection
list.

```
<mat-selection-list disabled>
  <mat-list-option>A</mat-list-option>
  <!-- ^ should have tabindex="-1" since entire list is disabled -->
</mat-selection-list>
```

Approach is to consider a disabled mat-selection-list with a mat-list-option
having `tabindex="0"` an invalid state. When disabled Input on the seleciton
list is set to true, set tabindex to -1 on every list option.

fixes angular#25730
@zarend zarend closed this as completed in 6ed06a7 Oct 12, 2022
@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 Nov 12, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Accessibility This issue is related to accessibility (a11y) area: material/list P3 An issue that is relevant to core functions, but does not impede progress. Important, but not urgent
Projects
None yet
Development

No branches or pull requests

1 participant