diff --git a/src/@batch-flask/ui/callout/callout.directive.ts b/src/@batch-flask/ui/callout/callout.directive.ts index baa9111077..0cba29710b 100644 --- a/src/@batch-flask/ui/callout/callout.directive.ts +++ b/src/@batch-flask/ui/callout/callout.directive.ts @@ -3,6 +3,7 @@ import { TemplatePortal } from "@angular/cdk/portal"; import { Directive, ElementRef, HostListener, Input, ViewContainerRef } from "@angular/core"; import { Subscription } from "rxjs"; import { CalloutComponent } from "./callout.component"; +import { ENTER, SPACE } from "@batch-flask/core/keys"; @Directive({ selector: "[blCallout]", @@ -25,6 +26,17 @@ export class CalloutDirective { } } + @HostListener("keydown", ["$event"]) + public onkeydown(event: KeyboardEvent) { + if (event.key === SPACE || event.key === ENTER) { + if (this._overlayRef) { + this.close(); + } else { + this.open(); + } + } + } + public open() { this._overlayRef = this.overlay.create(this._getOverlayConfig()); this._backDropClickSub = this._overlayRef.backdropClick().subscribe(() => { diff --git a/src/@batch-flask/ui/callout/callout.html b/src/@batch-flask/ui/callout/callout.html index 0c084b3f5f..f23afbbec7 100644 --- a/src/@batch-flask/ui/callout/callout.html +++ b/src/@batch-flask/ui/callout/callout.html @@ -1,5 +1,5 @@ -
+
diff --git a/src/app/components/account/details/account-details.html b/src/app/components/account/details/account-details.html index 0b506d9d13..afcaf53945 100644 --- a/src/app/components/account/details/account-details.html +++ b/src/app/components/account/details/account-details.html @@ -9,7 +9,7 @@

{{'account-details.resources' | i18n }}