From 9634d4763a0f710a318fd4eda57e70da1de99403 Mon Sep 17 00:00:00 2001 From: Tzipi <101048005+Tzipi-kaltura@users.noreply.github.com> Date: Thu, 7 Nov 2024 18:43:37 +0200 Subject: [PATCH] fix(ADA-1777): University of Illinois Urbana-Champaign (ADA) V7 player issues Priority 2(#8) transcript panel does not immediately follow the toggle button (#66) Add functionality to focus on plugin button and in case it's inside more button it focus will be on more plugin --- .../upper-bar-manager/upper-bar-manager.tsx | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/src/services/upper-bar-manager/upper-bar-manager.tsx b/src/services/upper-bar-manager/upper-bar-manager.tsx index fe28700..fe57d03 100644 --- a/src/services/upper-bar-manager/upper-bar-manager.tsx +++ b/src/services/upper-bar-manager/upper-bar-manager.tsx @@ -76,6 +76,19 @@ export class UpperBarManager { return icons.sort((a, b) => iconsOrder[a.displayName] - iconsOrder[b.displayName]); } + public focusPluginButton(pluginId: number) { + let pluginButton; + const controls = this.getControls(this.iconsOrder); + const pluginElement = controls.find((control) => control.id === pluginId)?.componentRef?.current?.base as HTMLElement; + if (pluginElement) { + pluginButton = pluginElement.querySelector('[tabindex="0"]') as HTMLElement; + } else { + const rightControls = this.displayedBarComponentRefs.Playback.current?.base as HTMLElement; + const buttons = rightControls.querySelectorAll('[tabindex="0"]'); + pluginButton = buttons[buttons.length - 1] as HTMLElement; + } + pluginButton?.focus(); + } private injectDisplayedBarComponentWrapper(): void { const iconsOrder = this.iconsOrder; for (const preset of UPPER_BAR_PRESETS) {