@mtes-mct/monitor-ui 2.14.3 → 2.14.4
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 +7 -0
- package/index.js +7 -0
- package/index.js.map +1 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,10 @@
|
|
|
1
|
+
## [2.14.3](https://github.com/MTES-MCT/monitor-ui/compare/v2.14.2...v2.14.3) (2023-02-09)
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
### Bug Fixes
|
|
5
|
+
|
|
6
|
+
* **fields:** enforce error margins ([eb69017](https://github.com/MTES-MCT/monitor-ui/commit/eb69017e720bb97a64fac46cd3d35ae18b6b60a5))
|
|
7
|
+
|
|
1
8
|
## [2.14.2](https://github.com/MTES-MCT/monitor-ui/compare/v2.14.1...v2.14.2) (2023-02-08)
|
|
2
9
|
|
|
3
10
|
|
package/index.js
CHANGED
|
@@ -5685,6 +5685,13 @@ function FormikCheckbox({ name, ...originalProps }) {
|
|
|
5685
5685
|
const handleChange = useMemo(() => helpers.setValue, []);
|
|
5686
5686
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
5687
5687
|
const isDefaultChecked = useMemo(() => Boolean(field.value), []);
|
|
5688
|
+
// A checkbox must initialize its Formik value on mount:
|
|
5689
|
+
// it wouldn't make sense to keep it as `undefined` since `undefined` means `false` in the case of a checkbox
|
|
5690
|
+
useEffect(() => {
|
|
5691
|
+
helpers.setValue(isDefaultChecked);
|
|
5692
|
+
},
|
|
5693
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
5694
|
+
[]);
|
|
5688
5695
|
return (jsx(Checkbox, { defaultChecked: isDefaultChecked, error: meta.error, name: name, onChange: handleChange, ...originalProps }));
|
|
5689
5696
|
}
|
|
5690
5697
|
|