@trackunit/react-form-components 0.0.376 → 0.0.378
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/index.cjs.js +3 -0
- package/index.esm.js +3 -0
- package/package.json +1 -1
package/index.cjs.js
CHANGED
|
@@ -1874,6 +1874,9 @@ Select.displayName = "Select";
|
|
|
1874
1874
|
const FormFieldSelectAdapter = React.forwardRef((_a, ref) => {
|
|
1875
1875
|
var { className, dataTestId, helpText, helpAddon, tip, label, disabled, isInvalid, errorMessage, name, onBlur, options, value, defaultValue, id, onChange, children } = _a, rest = __rest(_a, ["className", "dataTestId", "helpText", "helpAddon", "tip", "label", "disabled", "isInvalid", "errorMessage", "name", "onBlur", "options", "value", "defaultValue", "id", "onChange", "children"]);
|
|
1876
1876
|
const [innerValue, setInnerValue] = React.useState(value || defaultValue);
|
|
1877
|
+
React.useEffect(() => {
|
|
1878
|
+
setInnerValue(defaultValue);
|
|
1879
|
+
}, [defaultValue]);
|
|
1877
1880
|
const renderAsInvalid = isInvalid === undefined ? Boolean(errorMessage) : isInvalid;
|
|
1878
1881
|
const htmlFor = React.useMemo(() => (id ? id : "selectField-" + uuid.v4()), [id]);
|
|
1879
1882
|
const innerRef = React.useRef(null);
|
package/index.esm.js
CHANGED
|
@@ -1844,6 +1844,9 @@ Select.displayName = "Select";
|
|
|
1844
1844
|
const FormFieldSelectAdapter = forwardRef((_a, ref) => {
|
|
1845
1845
|
var { className, dataTestId, helpText, helpAddon, tip, label, disabled, isInvalid, errorMessage, name, onBlur, options, value, defaultValue, id, onChange, children } = _a, rest = __rest(_a, ["className", "dataTestId", "helpText", "helpAddon", "tip", "label", "disabled", "isInvalid", "errorMessage", "name", "onBlur", "options", "value", "defaultValue", "id", "onChange", "children"]);
|
|
1846
1846
|
const [innerValue, setInnerValue] = useState(value || defaultValue);
|
|
1847
|
+
useEffect(() => {
|
|
1848
|
+
setInnerValue(defaultValue);
|
|
1849
|
+
}, [defaultValue]);
|
|
1847
1850
|
const renderAsInvalid = isInvalid === undefined ? Boolean(errorMessage) : isInvalid;
|
|
1848
1851
|
const htmlFor = useMemo(() => (id ? id : "selectField-" + v4()), [id]);
|
|
1849
1852
|
const innerRef = useRef(null);
|