How to use the @material/menu-surface.MDCMenuSurfaceFoundation.cssClasses function in @material/menu-surface

To help you get started, we’ve selected a few @material/menu-surface examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github jamesmfriedman / rmwc / src / menu / menu-surface.tsx View on Github external
componentDidMount() {
    if (this.root.ref) {
      const anchor = closest(
        this.root.ref,
        `.${MDCMenuSurfaceFoundation.cssClasses.ANCHOR}`
      );
      anchor && (this.anchorElement = anchor);
    }
    // this has to be run AFTER we try to get our anchor
    super.componentDidMount();
  }
github jamesmfriedman / rmwc / src / menu / menu-surface-foundation.tsx View on Github external
useEffect(() => {
    const el = rootEl.ref;

    if (el) {
      const anchor = closest(
        el,
        `.${MDCMenuSurfaceFoundation.cssClasses.ANCHOR}`
      );
      anchor && (anchorElementRef.current = anchor);
    }
  }, [rootEl.ref]);