Sha256: 55040cb37d15535be582f0b6aba6e9ff279cd1ab1607be0c5a9c26f1082ded1f
Contents?: true
Size: 852 Bytes
Versions: 23
Compression:
Stored size: 852 Bytes
Contents
import { CocoComponent } from "@assets/js/coco/component"; export default CocoComponent("seamlessTextarea", () => { return { height: null, observer: null, value: null, options: ["multiline", "focus"], init() { this.value = this.$refs.textarea.value; this.$nextTick(() => { this.onResize(); if (this.$options.focus) { this.$refs.textarea.focus(); this.$refs.textarea.selectionStart = this.$refs.textarea.value.length; } }); }, onResize() { const textarea = this.$refs.textarea; if (textarea) { textarea.style.height = "4px"; const newHeight = textarea.scrollHeight; textarea.style.height = `${newHeight}px`; if (this.height !== newHeight) { this.height = newHeight; } } }, }; });
Version data entries
23 entries across 23 versions & 1 rubygems