Skip to content

Commit

Permalink
fix(ADA-1777): University of Illinois Urbana-Champaign (ADA) V7 playe…
Browse files Browse the repository at this point in the history
…r 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
  • Loading branch information
Tzipi-kaltura authored Nov 7, 2024
1 parent 88451c1 commit 9634d47
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions src/services/upper-bar-manager/upper-bar-manager.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down

0 comments on commit 9634d47

Please sign in to comment.