How to use the @material/select.cssClasses.FOCUSED function in @material/select

To help you get started, we’ve selected a few @material/select 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 / select / select-foundation.tsx View on Github external
const doWork = () => {
          const value = f.getValue();

          // This is the line we have to override to work with placeholders
          // we need to consider haveing a placeholder as a valid value
          const optionHasValue = !!getProps().placeholder || value.length > 0;

          if (adapter.hasLabel()) {
            f.notchOutline(optionHasValue);

            if (!adapter.hasClass(cssClasses.FOCUSED)) {
              adapter.floatLabel(optionHasValue);
            }
          }
        };