mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-02-16 10:58:30 -05:00
Bug/accessibility - Focus related issues (#6859)
* fix for https://github.com/microsoft/azuredatastudio/issues/6798 * fix for https://github.com/microsoft/azuredatastudio/issues/6851
This commit is contained in:
@@ -130,14 +130,22 @@ export class DialogPane extends Disposable implements IThemable {
|
||||
});
|
||||
}
|
||||
|
||||
public show(): void {
|
||||
public show(focus: boolean = false): void {
|
||||
this._body.classList.remove('dialogModal-hidden');
|
||||
if (focus) {
|
||||
this.focus();
|
||||
}
|
||||
}
|
||||
|
||||
public hide(): void {
|
||||
this._body.classList.add('dialogModal-hidden');
|
||||
}
|
||||
|
||||
private focus(): void {
|
||||
let focusedElement = <HTMLElement>this._body.querySelector('a[href], area[href], input:not([disabled]), select:not([disabled]), textarea:not([disabled]), button:not([disabled])');
|
||||
focusedElement ? focusedElement.focus() : this._body.focus();
|
||||
}
|
||||
|
||||
/**
|
||||
* Called by the theme registry on theme change to style the component
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user