@hzab/form-render 1.6.6 → 1.6.7

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,4 +1,4 @@
1
- # @hzab/form-render@1.6.6
1
+ # @hzab/form-render@1.6.7
2
2
 
3
3
  fix: 修复 LocationListPicker 组件在编辑时第一次无法正确渲染的 bug。
4
4
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hzab/form-render",
3
- "version": "1.6.6",
3
+ "version": "1.6.7",
4
4
  "description": "",
5
5
  "main": "src",
6
6
  "scripts": {
@@ -60,16 +60,19 @@ export const LocationListPicker = observer((props) => {
60
60
  }, []);
61
61
 
62
62
  useEffect(() => {
63
- listRef.current = value || [];
64
- if (!Array.isArray(value) || value?.length == 0 || !mapUtilsRef.current) {
63
+ if (!Array.isArray(value) || value?.length == 0) {
65
64
  return;
66
65
  }
66
+ listRef.current = value || [];
67
67
  // 处理 id
68
68
  value?.forEach((it) => {
69
69
  if (!it.id) {
70
70
  it.id = nanoid();
71
71
  }
72
72
  });
73
+ if (!mapUtilsRef.current) {
74
+ return;
75
+ }
73
76
  renderMarker();
74
77
  }, [value]);
75
78
 
@@ -89,6 +92,7 @@ export const LocationListPicker = observer((props) => {
89
92
  mapUtilsRef.current.setCircle(item.longitude, item.latitude, item.range, { ...item });
90
93
  }
91
94
  });
95
+ mapUtilsRef.current.setFitView();
92
96
  clearActive();
93
97
  }
94
98
 
@@ -106,7 +110,6 @@ export const LocationListPicker = observer((props) => {
106
110
  });
107
111
 
108
112
  renderMarker();
109
- mapUtilsRef.current.setFitView();
110
113
  }
111
114
 
112
115
  function onAddClick() {