Down arrow moves focus to extensions list#53616
Down arrow moves focus to extensions list#53616ramya-rao-a merged 12 commits intomicrosoft:masterfrom
Conversation
|
@joaomoreno you own the list view right? Should this be a part of all lists or keep it to extensions for now? |
| this.onDidFocus = mapEvent(domEvent(this.view.domNode, 'focus', true), () => null); | ||
| this.onDidBlur = mapEvent(domEvent(this.view.domNode, 'blur', true), () => null); | ||
|
|
||
| this.onDidFocus(() => this.focusFirstItemIfNothingFocused(), this, this.disposables); |
There was a problem hiding this comment.
I really don't think this is the best behaviour for the list. The default behaviour of DOM focus should be just that, not focusing an element.
|
|
||
| focus(): void { | ||
| super.focus(); | ||
| this.list.domFocus(); |
This comment was marked as resolved.
This comment was marked as resolved.
Sorry, something went wrong.
This comment was marked as resolved.
This comment was marked as resolved.
Sorry, something went wrong.
This comment was marked as resolved.
This comment was marked as resolved.
Sorry, something went wrong.
This comment was marked as resolved.
This comment was marked as resolved.
Sorry, something went wrong.
|
@joaomoreno I'd prefer to keep the implementation for |
|
Oh... that seems inconsistent. IMO a focused element in an inactive tree/list should not have a background... But now we have this: #46129 ... it's a pickle. I propose to set I would not keep this implementation simply because it is an accessibility issue that a widget's state changes when it gets DOM focus. The state (that the first element is focused) should have been there all along. |
4f94847 to
80a8e08
Compare
80a8e08 to
654e4e2
Compare
|
@joaomoreno I changed all the lists from an Also, it will be impossible to generalize this to extension provided list viewlets, as it requires knowledge of the model being used. Do you still think this is the best way forward? And is there a generalized content change event somewhere on either lists or trees that I'm not seeing? |
|
This now only addresses the original issue of navigating to the extensions list view on down arrow, in response to #53755 (comment) |
|
@ramya-rao-a this is entirely confined to the extensions viewlet now, if you want to take a look. We can update everything later, pending a decision on #53755 (comment) |
| this.list.model = model; | ||
| this.list.scrollTop = 0; | ||
| const count = this.count(); | ||
| this.list.focusNext(); |
There was a problem hiding this comment.
this makes more sense inside the new focus
| export const listInactiveSelectionBackground = registerColor('list.inactiveSelectionBackground', { dark: '#3F3F46', light: '#CCCEDB', hc: null }, nls.localize('listInactiveSelectionBackground', "List/Tree background color for the selected item when the list/tree is inactive. An active list/tree has keyboard focus, an inactive does not.")); | ||
| export const listInactiveSelectionForeground = registerColor('list.inactiveSelectionForeground', { dark: null, light: null, hc: null }, nls.localize('listInactiveSelectionForeground', "List/Tree foreground color for the selected item when the list/tree is inactive. An active list/tree has keyboard focus, an inactive does not.")); | ||
| export const listInactiveFocusBackground = registerColor('list.inactiveFocusBackground', { dark: '#313135', light: '#d8dae6', hc: null }, nls.localize('listInactiveSelectionBackground', "List/Tree background color for the selected item when the list/tree is inactive. An active list/tree has keyboard focus, an inactive does not.")); | ||
| export const listInactiveFocusBackground = registerColor('list.inactiveFocusBackground', { dark: null, light: null, hc: null }, nls.localize('listInactiveFocusBackground', "List/Tree background color for the focused item when the list/tree is inactive. An active list/tree has keyboard focus, an inactive does not.")); |
Closes #53185