How to use the autosize function in autosize

To help you get started, we’ve selected a few autosize 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 reactioncommerce / reaction / packages / reaction-product-variant / client / templates / products / productDetail / edit / edit.js View on Github external
}
              }
            );
          }
          // animate updated field
          // TODO this needs to be moved into a component
          return $(event.currentTarget).animate({
            backgroundColor: "#e2f2e2"
          }).animate({
            backgroundColor: "#fff"
          });
        }
      });

    if (this.type === "textarea") {
      autosize($(event.currentTarget));
    }

    return Session.set("editing-" + this.field, false);
  }
});
github buyou0821 / tyche-ui / components / input / Textarea.tsx View on Github external
useEffect(() => {
    if (autoSize && ref.current instanceof HTMLTextAreaElement) {
      autosize(ref.current);
    }
    return () => {
      if (ref.current instanceof HTMLTextAreaElement) {
        autosize.destroy(ref.current);
      }
    };
  }, [autoSize]);
github sakitam-fdd / ol-plot / src / text / TextArea.js View on Github external
creatTextArea (params) {
    let text = document.createElement('textarea')
    text.style.width = params['width'] + 'px'
    text.style.height = params['height'] + 'px'
    text.setAttribute('autofocus', true)
    text.setAttribute('id', this._uuid)
    text.setAttribute('data-coordinates', JSON.stringify(params['center']))
    text.className = 'ol-plot-text-area'
    autosize(text)
    Events.listen(text, 'blur', this.textOnBlur, this)
    Events.listen(text, 'focus', this.textOnFocus, this)
    Events.listen(text, 'autosize:resized', this.textResized, this)
    this.textOverlay = new ol.Overlay({
      id: this._uuid,
      element: text,
      position: params['center'],
      positioning: 'top-right'
    })
    this.setTextAreaStyle(DEF_TEXT_STYEL)
    this.map.addOverlay(this.textOverlay)
    this.map.render()
  }
github nexxtway / react-rainbow / src / components / Textarea / index.js View on Github external
componentDidMount() {
        const { grow } = this.props;
        if (grow) {
            return autosize(this.textareaRef.current);
        }
        return null;
    }
github sakitam-fdd / ol-plot / src / Geometry / Text / TextArea.js View on Github external
creatTextArea (params) {
    let content = document.createElement('div')
    content.className = 'ol-plot-text-area-content'
    let text = document.createElement('textarea')
    let editer = document.createElement('div')
    let [width, height] = [20, 20]
    editer.innerHTML = '<svg height="' + height + '" width="' + width + '" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns="http://www.w3.org/2000/svg" version="1.1" viewBox="0 0 1024 1024" style="" class="icon"><defs><style type="text/css"></style></defs><path d="M959.69595 511.965208 792.498974 344.836793 792.498974 459.036741 564.963771 459.036741 564.963771 231.501538 679.162696 231.501538 511.982092 64.303538 344.819908 231.501538 459.019857 231.501538 459.019857 459.036741 231.484653 459.036741 231.484653 344.836793 64.303027 512.034792 231.484653 679.153998 231.484653 564.963259 459.019857 564.963259 459.019857 792.498462 344.819908 792.498462 512.016885 959.695438 679.162696 792.498462 564.963771 792.498462 564.963771 564.963259 792.498974 564.963259 792.498974 679.153998Z"></path></svg>'
    editer.className = 'ol-plot-text-area-editor'
    text.style.width = params['width'] + 'px'
    text.style.height = params['height'] + 'px'
    text.setAttribute('autofocus', true)
    text.setAttribute('id', this._uuid)
    text.setAttribute('data-coordinates', JSON.stringify(params['center']))
    text.className = 'ol-plot-text-area'
    autosize(text)
    Events.listen(text, 'blur', this.textOnBlur, this)
    Events.listen(text, 'focus', this.textOnFocus, this)
    Events.listen(text, 'autosize:resized', this.textResized)
    Events.listen(editer, EventType.MOUSEDOWN, this.mouseDownHandle_, this)
    Events.addListener(editer, 'mousemove', this.controlPointMouseMoveHandler2, this)
    content.appendChild(text)
    content.appendChild(editer)
    this.textOverlay = new ol.Overlay({
      id: this._uuid,
      element: content,
      position: params['center'],
      positioning: 'right-top'
    })
    this.setTextAreaStyle(DEF_TEXT_STYEL)
    this.map.addOverlay(this.textOverlay)
    this.map.render()
github Esri / storymap-crowdsource / src / app / components / viewerDialogs / appSharing / AppSharing.babel.js View on Github external
componentDidMount() {
    const embedSizeDropdown = this.embedSizeDropdown;

    $(embedSizeDropdown).dropdown();

    this.selectAllFromNode(this.linkInput);

    if (this.copySupported) {
      const clipboard = new Clipboard('.app-share .copy-button');

      clipboard.on('success',this.onCopy);
    }

    autosize(this.embedCodeInput);
  }
github Esri / storymap-crowdsource / src / app / components / forms / textarea / Textarea.babel.js View on Github external
componentDidMount() {
    super.componentDidMount();
    autosize(this.input);
  }
github stefanzweifel / diary-app / resources / assets / js / router / views / EntryEditorView.vue View on Github external
updateSizeOfTextarea() {
            autosize(document.querySelector('textarea'));
        },

autosize

Autosize is a small, stand-alone script to automatically adjust textarea height to fit text.

MIT
Latest version published 1 year ago

Package Health Score

67 / 100
Full package analysis