Options
All
  • Public
  • Public/Protected
  • All
Menu

Hierarchy

Index

Constructors

constructor

  • Parameters

    • root: Element
    • Optional foundation: FoundationType
    • Rest ...args: Array<unknown>

    Returns MDCMenuSurface

Properties

anchorElement

anchorElement: Element | null

Protected foundation_

Protected root_

root_: HTMLElement

Accessors

open

  • get open(): boolean
  • set open(value: boolean): void

quickOpen

  • set quickOpen(quickOpen: boolean): void

Methods

destroy

  • destroy(): void

emit

  • emit<T>(evtType: string, evtData: T, shouldBubble?: boolean): void
  • Fires a cross-browser-compatible custom event from the component root of the given type, with the given data.

    Type parameters

    • T: object

    Parameters

    • evtType: string
    • evtData: T
    • Default value shouldBubble: boolean = false

    Returns void

getDefaultFoundation

hoistMenuToBody

  • hoistMenuToBody(): void
  • Removes the menu-surface from it's current location and appends it to the body to overcome any overflow:hidden issues.

    Returns void

initialSyncWithDOM

  • initialSyncWithDOM(): void

initialize

  • initialize(..._args: Array<unknown>): void
  • Parameters

    • Rest ..._args: Array<unknown>

    Returns void

listen

  • Wrapper method to add an event listener to the component's root element. This is most useful when listening for custom events.

    Type parameters

    Parameters

    Returns void

  • Type parameters

    • E: Event

    Parameters

    Returns void

setAbsolutePosition

  • setAbsolutePosition(x: number, y: number): void
  • Sets the absolute x/y position to position based on. Requires the menu to be hoisted.

    Parameters

    • x: number
    • y: number

    Returns void

setAnchorCorner

  • setAnchorCorner(corner: Corner): void

setAnchorMargin

setFixedPosition

  • setFixedPosition(isFixed: boolean): void

setIsHoisted

  • setIsHoisted(isHoisted: boolean): void
  • Sets the foundation to use page offsets for an positioning when the menu is hoisted to the body.

    Parameters

    • isHoisted: boolean

    Returns void

setMenuSurfaceAnchorElement

  • setMenuSurfaceAnchorElement(element: Element): void

unlisten

  • Wrapper method to remove an event listener to the component's root element. This is most useful when unlistening for custom events.

    Type parameters

    Parameters

    Returns void

  • Type parameters

    • E: Event

    Parameters

    Returns void

Static attachTo

Generated using TypeDoc