This commit is contained in:
2026-05-24 02:56:19 +03:00
parent ecd79ebd01
commit 9db7b1e54b
+7 -4
View File
@@ -15,17 +15,20 @@ export class AutoExpand {
this.target.rows = 1; this.target.rows = 1;
this.target.style.overflowY = 'hidden'; this.target.style.overflowY = 'hidden';
this.target.style.resize = 'none';
this.target.dxOn('input.autoExpand', _ => this.updateRows() ) this.updateSize();
this.target.dxOn('input.autoExpand', _ => this.updateSize() );
} }
/** /**
* AutoExpand, Update Rows * AutoExpand, Update Size
*/ */
updateRows() { updateSize() {
const style = window.getComputedStyle(this.target); const style = window.getComputedStyle(this.target);
this.target.style.height = 'auto'; this.target.style.height = 'auto';
this.target.style.height = `${this.target.scrollHeight + (parseFloat(style.borderTopWidth) || 0) + (parseFloat(style.borderBottomWidth) || 0)}px`; this.target.style.height = `${this.target.scrollHeight + (parseFloat(style.borderTopWidth) || 0) + (parseFloat(style.borderBottomWidth) || 0)}px`;
} }