Options
All
  • Public
  • Public/Protected
  • All
Menu

Interface MDCMenuAdapter

Implement this adapter for your framework of choice to delegate updates to the component in your framework of choice. See architecture documentation for more details. https://github.com/material-components/material-components-web/blob/master/docs/code/architecture.md

Hierarchy

  • MDCMenuAdapter

Index

Methods

addAttributeToElementAtIndex

  • addAttributeToElementAtIndex(index: number, attr: string, value: string): void
  • Adds an attribute, with value, to the element at the index provided.

    Parameters

    • index: number
    • attr: string
    • value: string

    Returns void

addClassToElementAtIndex

  • addClassToElementAtIndex(index: number, className: string): void
  • Adds a class to the element at the index provided.

    Parameters

    • index: number
    • className: string

    Returns void

closeSurface

  • closeSurface(): void

elementContainsClass

  • elementContainsClass(element: Element, className: string): boolean
  • Parameters

    • element: Element
    • className: string

    Returns boolean

    true if the element contains the className.

focusItemAtIndex

  • focusItemAtIndex(index: number): void
  • Focuses the menu item at given index.

    Parameters

    • index: number

      Index of the menu item that will be focused every time the menu opens.

    Returns void

focusListRoot

  • focusListRoot(): void

getElementIndex

  • getElementIndex(element: Element): number
  • Parameters

    • element: Element

    Returns number

    Index of the element in the list or -1 if it is not in the list.

getMenuItemCount

  • getMenuItemCount(): number

getParentElement

  • getParentElement(element: Element): Element | null
  • Parameters

    • element: Element

    Returns Element | null

    The parentElement of the provided element.

getSelectedElementIndex

  • getSelectedElementIndex(selectionGroup: Element): number
  • Parameters

    • selectionGroup: Element

    Returns number

    The element within the selectionGroup containing the selected element class.

notifySelected

removeAttributeFromElementAtIndex

  • removeAttributeFromElementAtIndex(index: number, attr: string): void
  • Removes an attribute from an element at the index provided.

    Parameters

    • index: number
    • attr: string

    Returns void

removeClassFromElementAtIndex

  • removeClassFromElementAtIndex(index: number, className: string): void
  • Removes a class from the element at the index provided

    Parameters

    • index: number
    • className: string

    Returns void

Generated using TypeDoc