PageSourceSearch

https://railsblocks.com/assets/controllers/autogrow_controller-dc2…4de74ed0e4d064eb86467f918cd1c4fc3a32db15.js

js railsblocks.com collected 2026-10-03 23:52:48 UTC 562 bytes, 21 lines download raw bytes

1import { Controller } from "@hotwired/stimulus";
2
3export default class extends Controller {
4  connect() {
5    this.autogrow();
6  }
7
8  autogrow() {
9    // Check if cursor is at the end before resizing
10    const cursorAtEnd = this.element.selectionStart === this.element.value.length;
11
12    // Resize the textarea
13    this.element.style.height = "auto";
14    this.element.style.height = `${this.element.scrollHeight}px`;
15
16    // If cursor was at the end, scroll to bottom
17    if (cursorAtEnd) {
18      this.element.scrollTop = this.element.scrollHeight;
19    }
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.