Interface TextTrackStyleMenuProps

interface TextTrackStyleMenuProps {
    attributeChangedCallback?: (
        attrName: string,
        oldValue: any,
        newValue: any,
    ) => void;
    children?: ReactNode;
    closeCurrentMenu?: () => boolean;
    closeMenu?: (menuId?: string) => boolean;
    connectedCallback?: () => void;
    disconnectedCallback?: () => void;
    getMenuById?: (menuId?: string) => undefined | Menu | MenuGroup;
    hasCurrentMenu?: () => boolean;
    heading?: ReactNode;
    isMenuOpen?: (menuId?: string) => boolean;
    openMenu?: (menuId?: string, opener?: HTMLElement) => boolean;
}

Hierarchy (View Summary)

Properties

attributeChangedCallback?: (
    attrName: string,
    oldValue: any,
    newValue: any,
) => void
children?: ReactNode

The menu's contents.

closeCurrentMenu?: () => boolean

Type declaration

    • (): boolean
    • Close the current menu.

      Returns boolean

closeMenu?: (menuId?: string) => boolean

Type declaration

    • (menuId?: string): boolean
    • Closes the menu with the given ID.

      If no ID is given, then the entire menu group is closed.

      If the given menu has opened one or more submenus, then those are also closed. If the last open menu is closed, then the menu group also becomes closed.

      Parameters

      • OptionalmenuId: string

        The ID of the menu to close.

      Returns boolean

      True if the given menu was found and closed.

connectedCallback?: () => void
disconnectedCallback?: () => void
getMenuById?: (menuId?: string) => undefined | Menu | MenuGroup

Type declaration

    • (menuId?: string): undefined | Menu | MenuGroup
    • Get the menu with the given ID.

      Parameters

      • OptionalmenuId: string

        The ID of the menu. If unset, returns this menu group.

      Returns undefined | Menu | MenuGroup

hasCurrentMenu?: () => boolean

Type declaration

    • (): boolean
    • Whether this menu group has a currently open menu.

      Returns boolean

heading?: ReactNode

A slot for the menu's heading.

isMenuOpen?: (menuId?: string) => boolean

Type declaration

    • (menuId?: string): boolean
    • Whether the menu with the given ID is currently open.

      Parameters

      • OptionalmenuId: string

        The ID of the menu.

      Returns boolean

openMenu?: (menuId?: string, opener?: HTMLElement) => boolean

Type declaration

    • (menuId?: string, opener?: HTMLElement): boolean
    • Open the menu with the given ID.

      If no ID is given, the first menu in the group is opened.

      If there's already an open menu, then the new menu is opened as a "submenu". When it closed, the previous menu is opened.

      Parameters

      • OptionalmenuId: string

        The ID of the menu to open.

      • Optionalopener: HTMLElement

        The control that opened the menu. When the menu is closed, focus is moved back to this control.

      Returns boolean

      True if the given menu was found.