How to use the update-input-width.getFontShorthand function in update-input-width

To help you get started, we’ve selected a few update-input-width 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 wojtekmaj / react-time-picker / src / TimeInput / Input.jsx View on Github external
function updateInputWidthOnFontLoad(element) {
  if (!document.fonts) {
    return;
  }

  const font = getFontShorthand(element);

  if (!font) {
    return;
  }

  const isFontLoaded = document.fonts.check(font);

  if (isFontLoaded) {
    return;
  }

  function onLoadingDone() {
    updateInputWidth(element);
  }

  document.fonts.addEventListener('loadingdone', onLoadingDone);
github wojtekmaj / react-date-picker / src / DateInput / Input.jsx View on Github external
function updateInputWidthOnFontLoad(element) {
  if (!document.fonts) {
    return;
  }

  const font = getFontShorthand(element);

  if (!font) {
    return;
  }

  const isFontLoaded = document.fonts.check(font);

  if (isFontLoaded) {
    return;
  }

  function onLoadingDone() {
    updateInputWidth(element);
  }

  document.fonts.addEventListener('loadingdone', onLoadingDone);

update-input-width

A function that given input element, updates its width to fit its content.

MIT
Latest version published 1 year ago

Package Health Score

60 / 100
Full package analysis

Popular update-input-width functions