-
Notifications
You must be signed in to change notification settings - Fork 6.8k
fix(selection-list): support selecting all via ctrl + a #11502
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
fix(selection-list): support selecting all via ctrl + a #11502
Conversation
@@ -394,6 +394,12 @@ export class MatSelectionList extends _MatSelectionListMixinBase implements Focu | |||
keyCode === HOME ? manager.setFirstItemActive() : manager.setLastItemActive(); | |||
event.preventDefault(); | |||
break; | |||
case A: | |||
if (event.ctrlKey) { | |||
this.options.find(option => !option.selected) ? this.selectAll() : this.deselectAll(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is the extra check necessary? Looks like _setAllOptionsSelected
already checks the existing state before considering the item "changed"
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We need to know whether there's at least one unselected option. The intended functionality is "deselect all if all are selected, otherwise select all".
e1aa42d
to
9ca09cc
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
If you can, could you push some new hash so that CircleCI tries to re-run? Would like it to be green before we merge |
Based on the a11y guidelines, listboxes can be able to select/deselect all using ctrl + a. These changes implement the keyboard shortcut on the selection list.
9ca09cc
to
78c6923
Compare
Done @andrewseguin. |
Based on the a11y guidelines, listboxes can be able to select/deselect all using ctrl + a. These changes implement the keyboard shortcut on the selection list.
This issue has been automatically locked due to inactivity. Read more about our automatic conversation locking policy. This action has been performed automatically by a bot. |
Based on the a11y guidelines, listboxes can be able to select/deselect all using ctrl + a. These changes implement the keyboard shortcut on the selection list.