@tuya/miniapp-smart-ui 2.13.6 → 2.13.7-beta-1
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.
- package/dist/field/index.js +5 -2
- package/lib/field/index.js +5 -2
- package/package.json +1 -1
package/dist/field/index.js
CHANGED
|
@@ -99,8 +99,11 @@ SmartComponent({
|
|
|
99
99
|
}
|
|
100
100
|
const formatValue = this.formatValue(rawValue);
|
|
101
101
|
this.value = formatValue;
|
|
102
|
-
//
|
|
103
|
-
|
|
102
|
+
// 仅在显示值需要与原生值不同时回写(数字格式化或超长截断)。
|
|
103
|
+
// 输入过程中回写 value 会让 iOS 原生 textarea 在连续删除时光标跳到末尾。
|
|
104
|
+
if (numberFormat || formatValue !== value) {
|
|
105
|
+
this.updateDisplayValue();
|
|
106
|
+
}
|
|
104
107
|
this.setShowClear();
|
|
105
108
|
return this.emitChange(Object.assign(Object.assign({}, event.detail), { value: formatValue }));
|
|
106
109
|
},
|
package/lib/field/index.js
CHANGED
|
@@ -115,8 +115,11 @@ var numberFormat_1 = require("./numberFormat");
|
|
|
115
115
|
}
|
|
116
116
|
var formatValue = this.formatValue(rawValue);
|
|
117
117
|
this.value = formatValue;
|
|
118
|
-
//
|
|
119
|
-
|
|
118
|
+
// 仅在显示值需要与原生值不同时回写(数字格式化或超长截断)。
|
|
119
|
+
// 输入过程中回写 value 会让 iOS 原生 textarea 在连续删除时光标跳到末尾。
|
|
120
|
+
if (numberFormat || formatValue !== value) {
|
|
121
|
+
this.updateDisplayValue();
|
|
122
|
+
}
|
|
120
123
|
this.setShowClear();
|
|
121
124
|
return this.emitChange(__assign(__assign({}, event.detail), { value: formatValue }));
|
|
122
125
|
},
|