mirror of
https://github.com/Azure/cosmos-explorer.git
synced 2025-12-20 17:30:46 +00:00
Fix inaccessible link by keyboard nav in info bubble (#216)
* Fix inaccessible link by keyboard nav in info bubble * Fix shift-tab on link to focus previous element
This commit is contained in:
@@ -721,6 +721,29 @@ export default class AddCollectionPane extends ContextualPaneBase {
|
||||
TelemetryProcessor.trace(Action.CreateCollection, ActionModifiers.Open, addCollectionPaneOpenMessage);
|
||||
}
|
||||
|
||||
private transferFocus(elementIdToKeepVisible: string, elementIdToFocus: string): void {
|
||||
document.getElementById(elementIdToKeepVisible).style.visibility = "visible";
|
||||
document.getElementById(elementIdToFocus).focus();
|
||||
}
|
||||
|
||||
private onFocusOut(_: any, event: any): void {
|
||||
event.target.parentElement.style.visibility = "";
|
||||
}
|
||||
|
||||
private onMouseOut(_: any, event: any): void {
|
||||
event.target.style.visibility = "";
|
||||
}
|
||||
|
||||
private onKeyDown(previousActiveElementId: string, _: any, event: KeyboardEvent): boolean {
|
||||
if (event.shiftKey && event.keyCode == Constants.KeyCodes.Tab) {
|
||||
document.getElementById(previousActiveElementId).focus();
|
||||
return false;
|
||||
} else {
|
||||
// Execute default action
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
private _onDatabasesChange(newDatabaseIds: ViewModels.Database[]) {
|
||||
const cachedDatabaseIdsList = _.map(newDatabaseIds, (database: ViewModels.Database) => {
|
||||
if (database && database.offer && database.offer()) {
|
||||
|
||||
Reference in New Issue
Block a user