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

list.clear should clear both focus and selection in one go #78709

Merged
merged 3 commits into from
Aug 9, 2019

Conversation

isidorn
Copy link
Contributor

@isidorn isidorn commented Aug 8, 2019

Currently if you have a tree which is both selected and focused it takes two times to press esc to first clear the focus and then the selection.
This makes it harder for users to navigate up to the tree via focus. This affects accessibility and #1043 for example.

This PR changes this behavior that esc always clears both selection and focus.

@@ -751,7 +751,8 @@ KeybindingsRegistry.registerCommandAndKeybindingRule({

if (list.getSelection().length > 0) {
list.setSelection([]);
} else if (list.getFocus().length > 0) {
}
if (list.getFocus().length > 0) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why this check?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It was already there and I just did not remove it.
I guess all those checks do not really make sense now and should be removed.
We should just setSelection([]) and setFocus([])

@joaomoreno joaomoreno added this to the August 2019 milestone Aug 8, 2019
@joaomoreno joaomoreno assigned isidorn and unassigned joaomoreno Aug 8, 2019
@joaomoreno joaomoreno added accessibility Keyboard, mouse, ARIA, vision, screen readers (non-specific) issues list-widget List widget issues tree-widget Tree widget issues labels Aug 8, 2019
@isidorn
Copy link
Contributor Author

isidorn commented Aug 8, 2019

I pushed a simplified approach to this.
Also unrelated issue: esc does not clear the focus when in the extensions view.
It seems that both WorkbenchListFocusContextKey, WorkbenchListHasSelectionOrFocus are false when Extensions list has focus which is weird.

@isidorn isidorn merged commit 1f931a6 into master Aug 9, 2019
@isidorn isidorn deleted the isidorn/listClear branch August 9, 2019 07:44
@github-actions github-actions bot locked and limited conversation to collaborators Mar 27, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
accessibility Keyboard, mouse, ARIA, vision, screen readers (non-specific) issues list-widget List widget issues tree-widget Tree widget issues
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants