mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-01-16 17:22:29 -05:00
Addresses accessiblility bug by converting editable dropdowns to normal when in accessible mode (#7159)
* Automatically disabling editability on extension dropdowns when in accessible mode * correcting variable name type
This commit is contained in:
@@ -19,6 +19,7 @@ import { attachSelectBoxStyler } from 'vs/platform/theme/common/styler';
|
||||
|
||||
import { IWorkbenchThemeService } from 'vs/workbench/services/themes/common/workbenchThemeService';
|
||||
import { IContextViewService } from 'vs/platform/contextview/browser/contextView';
|
||||
import { IConfigurationService } from 'vs/platform/configuration/common/configuration';
|
||||
|
||||
@Component({
|
||||
selector: 'modelview-dropdown',
|
||||
@@ -35,6 +36,7 @@ export default class DropDownComponent extends ComponentBase implements ICompone
|
||||
@Input() modelStore: IModelStore;
|
||||
private _editableDropdown: Dropdown;
|
||||
private _selectBox: SelectBox;
|
||||
private _isInAccessibilityMode: boolean;
|
||||
|
||||
@ViewChild('editableDropDown', { read: ElementRef }) private _editableDropDownContainer: ElementRef;
|
||||
@ViewChild('dropDown', { read: ElementRef }) private _dropDownContainer: ElementRef;
|
||||
@@ -42,9 +44,14 @@ export default class DropDownComponent extends ComponentBase implements ICompone
|
||||
@Inject(forwardRef(() => ChangeDetectorRef)) changeRef: ChangeDetectorRef,
|
||||
@Inject(IWorkbenchThemeService) private themeService: IWorkbenchThemeService,
|
||||
@Inject(IContextViewService) private contextViewService: IContextViewService,
|
||||
@Inject(forwardRef(() => ElementRef)) el: ElementRef
|
||||
@Inject(forwardRef(() => ElementRef)) el: ElementRef,
|
||||
@Inject(IConfigurationService) private readonly configurationService: IConfigurationService
|
||||
) {
|
||||
super(changeRef, el);
|
||||
|
||||
if (this.configurationService) {
|
||||
this._isInAccessibilityMode = this.configurationService.getValue('editor.accessibilitySupport') === 'on';
|
||||
}
|
||||
}
|
||||
|
||||
ngOnInit(): void {
|
||||
@@ -112,7 +119,7 @@ export default class DropDownComponent extends ComponentBase implements ICompone
|
||||
this._editableDropdown.ariaLabel = this.ariaLabel;
|
||||
}
|
||||
|
||||
if (this.editable) {
|
||||
if (this.editable && !this._isInAccessibilityMode) {
|
||||
this._editableDropdown.values = this.getValues();
|
||||
if (this.value) {
|
||||
this._editableDropdown.value = this.getSelectedValue();
|
||||
@@ -186,11 +193,11 @@ export default class DropDownComponent extends ComponentBase implements ICompone
|
||||
}
|
||||
|
||||
public getEditableDisplay(): string {
|
||||
return this.editable ? '' : 'none';
|
||||
return this.editable && !this._isInAccessibilityMode ? '' : 'none';
|
||||
}
|
||||
|
||||
public getNotEditableDisplay(): string {
|
||||
return !this.editable ? '' : 'none';
|
||||
return !this.editable || this._isInAccessibilityMode ? '' : 'none';
|
||||
}
|
||||
|
||||
private set value(newValue: string | azdata.CategoryValue) {
|
||||
|
||||
Reference in New Issue
Block a user