From 73597d9696d72b14a8a871417810d651b1eb8caa Mon Sep 17 00:00:00 2001 From: g-jaskowski Date: Mon, 12 Aug 2024 09:44:44 +0200 Subject: [PATCH] ACS-8036 handle event when dropdown closed --- .../bulk-actions-dropdown.component.ts | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/projects/aca-content/src/lib/components/bulk-actions-dropdown/bulk-actions-dropdown.component.ts b/projects/aca-content/src/lib/components/bulk-actions-dropdown/bulk-actions-dropdown.component.ts index 80b3ba58af..ca2307740e 100644 --- a/projects/aca-content/src/lib/components/bulk-actions-dropdown/bulk-actions-dropdown.component.ts +++ b/projects/aca-content/src/lib/components/bulk-actions-dropdown/bulk-actions-dropdown.component.ts @@ -98,11 +98,18 @@ export class BulkActionsDropdownComponent implements OnInit, OnDestroy { this.onDestroy$.complete(); } - runAction(actionsDropdownEvent: BulkActionsDropdownSelectionEvent) { - if (actionsDropdownEvent.event.source.selected) { - this.extensions.runActionById(actionsDropdownEvent.actionOption.actions.click, { - focusedElementOnCloseSelector: '.adf-context-menu-source' - }); + runAction(actionOption: ContentActionRef) { + this.extensions.runActionById(actionOption.actions.click, { + focusedElementOnCloseSelector: '.adf-context-menu-source' + }); + } + + onKeyDown(event: KeyboardEvent) { + if (event.key === 'Tab') { + this.bulkSelectControl.setValue(null); + } + if (event.key === 'Enter' && this.bulkSelectControl.value) { + this.runAction(this.bulkSelectControl.value); } } }