@hzab/list-render 1.10.8 → 1.10.9

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/CHANGELOG.md CHANGED
@@ -1,3 +1,7 @@
1
+ # @hzab/list-render@1.10.9
2
+
3
+ fix: 行内编辑 解决 select 等表单项 focus 报错问题
4
+
1
5
  # @hzab/list-render@1.10.8
2
6
 
3
7
  feat: 行内编辑事件通过onEdit抛出 添加保存前自定义处理函数onEditReqVerify,返回Promise用于截断或正常执行
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hzab/list-render",
3
- "version": "1.10.8",
3
+ "version": "1.10.9",
4
4
  "description": "",
5
5
  "main": "src",
6
6
  "scripts": {
@@ -181,7 +181,10 @@ export const useEditTable = (props) => {
181
181
 
182
182
  useEffect(() => {
183
183
  if (editingId || editingKey) {
184
- editingFiledRef.current?.current?.focus?.();
184
+ try {
185
+ // HACK: try catch 解决 select 等表单项 focus 报错问题
186
+ editingFiledRef.current?.current?.focus?.();
187
+ } catch (error) {}
185
188
  }
186
189
  }, [editingId, editingKey]);
187
190
 
@@ -212,7 +215,7 @@ export const useEditTable = (props) => {
212
215
  try {
213
216
  // 点击保存,数据抛出
214
217
  (await formRender?.validate()) as Item;
215
- onEditSubmit && await onEditSubmit(formRender.values);
218
+ onEditSubmit && (await onEditSubmit(formRender.values));
216
219
  // 清除编辑目标
217
220
  setEditingId("");
218
221
  setEditingKey("");