PageSourceSearch

https://app.yuml.me/assets/controllers/autogrow_controller-52fe45af.js

js yuml.me collected 2026-10-02 04:33:33 UTC 595 bytes, 21 lines download raw bytes

1// Autogrows textareas based on content
2//
3// Example Usage:
4// <%= form.text_area :value, data: {controller: "autogrow", action: "input->autogrow#autogrow"} %>
5
6import { Controller } from "@hotwired/stimulus"
7
8export default class extends Controller {
9  connect() {
10    this.autogrow()
11  }
12
13  autogrow() {
14    this.element.style.height = 'auto'
15
16    // offsetHeight accounts for borders while clientHeight & scrollHeight do not
17    let borderHeight = (this.element.offsetHeight - this.element.clientHeight)
18
19    this.element.style.height = `${this.element.scrollHeight + borderHeight}px`
20  }
21}

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.