How to use the @material/textfield.MDCTextFieldIconFoundation function in @material/textfield

To help you get started, we’ve selected a few @material/textfield 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 / textfield / index.tsx View on Github external
getDefaultFoundation() {
    return new MDCTextFieldIconFoundation({
      getAttr: (attr: string) =>
        this.root.getProp(attr as any) as string | null,
      setAttr: (attr: string, value: string) =>
        this.root.setProp(attr as any, value),
      removeAttr: (attr: string) => this.root.removeProp(attr as any),
      setContent: (content: string) => {
        // @ts-ignore
        this.root.setProp('icon', content);
      },
      registerInteractionHandler: (
        evtType: K,
        handler: SpecificEventListener
      ): void => this.root.addEventListener(evtType, handler),
      deregisterInteractionHandler: (
        evtType: K,
        handler: SpecificEventListener