mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-01-20 01:25:37 -05:00
fix keyboard focus issues (#16206)
This commit is contained in:
@@ -382,12 +382,9 @@ export abstract class Modal extends Disposable implements IThemable {
|
||||
* Set focusable elements in the modal dialog
|
||||
*/
|
||||
public setInitialFocusedElement() {
|
||||
// Try to find focusable element in dialog pane rather than overall container. _modalBodySection contains items in the pane for a wizard.
|
||||
// This ensures that we are setting the focus on a useful element in the form when possible.
|
||||
const focusableElements = getFocusableElements(this._modalBodySection ?? this._bodyContainer!);
|
||||
|
||||
if (focusableElements && focusableElements.length > 0) {
|
||||
(<HTMLElement>focusableElements[0]).focus();
|
||||
const focusableElements = getFocusableElements(this._modalDialog!);
|
||||
if (focusableElements?.length > 0) {
|
||||
focusableElements[0].focus();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -56,6 +56,10 @@ export abstract class ComponentBase<TPropertyBag extends azdata.ComponentPropert
|
||||
this.modelStore.registerComponent(this);
|
||||
this._validations.push(() => this.modelStore.validate(this));
|
||||
}
|
||||
this.fireEvent({
|
||||
eventType: ComponentEventType.onComponentLoaded,
|
||||
args: undefined
|
||||
});
|
||||
}
|
||||
|
||||
abstract ngAfterViewInit(): void;
|
||||
|
||||
Reference in New Issue
Block a user