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
#68)

…r issues Priority 2(#8) transcript panel does not immediately follow the toggle button

Description of the Changes
Adding event.preventDefault before we focus the button.

part of kaltura/playkit-js-transcript#228

solves ADA-1777
  • Loading branch information
Tzipi-kaltura authored Nov 20, 2024
1 parent 386aa76 commit cef5e9f
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/services/upper-bar-manager/upper-bar-manager.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ export class UpperBarManager {
return moreElement?.querySelector('[tabindex="0"]') as HTMLButtonElement;
}

public focusPluginButton(pluginId: number) {
public focusPluginButton(pluginId: number, event?: KeyboardEvent) {
let pluginButton;
const controls = this.getControls(this.iconsOrder);
const pluginElement = controls.find((control) => control.id === pluginId)?.componentRef?.current?.base as HTMLElement;
Expand All @@ -90,7 +90,10 @@ export class UpperBarManager {
} else {
pluginButton = this.getMorePluginButton();
}
pluginButton?.focus();
if (pluginButton) {
event?.preventDefault();
pluginButton.focus();
}
}
private injectDisplayedBarComponentWrapper(): void {
const iconsOrder = this.iconsOrder;
Expand Down

0 comments on commit cef5e9f

Please sign in to comment.