easy3wui 1.5.46-beta5 → 1.5.46
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -56,14 +56,19 @@ var Easy3wGridTextArea = function (_Component) {
|
|
|
56
56
|
|
|
57
57
|
var textarea = document.getElementById(fieldId);
|
|
58
58
|
if (textarea) {
|
|
59
|
+
var scrollHeight = textarea.scrollHeight;
|
|
60
|
+
// scrollHeight属性表示元素内容的总高度,包括那些在视口中不可见的部分
|
|
61
|
+
// 2 边框
|
|
62
|
+
|
|
63
|
+
var scrollHeightNew = scrollHeight + 2;
|
|
59
64
|
// 监听输入事件
|
|
60
65
|
textarea.addEventListener('input', function () {
|
|
61
66
|
// 移除滚动条,以便正确计算内容高度
|
|
62
67
|
this.style.height = 'auto';
|
|
63
|
-
this.style.height =
|
|
68
|
+
this.style.height = scrollHeightNew + 'px';
|
|
64
69
|
});
|
|
65
70
|
// 初始时设置一次高度,确保页面加载时textarea高度正确
|
|
66
|
-
textarea.style.height =
|
|
71
|
+
textarea.style.height = scrollHeightNew + 'px';
|
|
67
72
|
}
|
|
68
73
|
}, _this.touchTransform = function (value) {
|
|
69
74
|
var strValue = value;
|