react-hook-form 7.39.0 → 7.39.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/index.cjs.js +1 -1
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.esm.mjs +8 -3
- package/dist/index.esm.mjs.map +1 -1
- package/dist/index.umd.js +1 -1
- package/dist/index.umd.js.map +1 -1
- package/dist/useController.d.ts.map +1 -1
- package/package.json +1 -1
package/dist/index.esm.mjs
CHANGED
@@ -395,10 +395,15 @@ function useController(props) {
|
|
395
395
|
},
|
396
396
|
type: EVENTS.BLUR,
|
397
397
|
}), [name, control]),
|
398
|
-
ref: (
|
398
|
+
ref: (elm) => {
|
399
399
|
const field = get(control._fields, name);
|
400
|
-
if (field &&
|
401
|
-
field._f.ref =
|
400
|
+
if (field && elm) {
|
401
|
+
field._f.ref = {
|
402
|
+
focus: () => elm.focus(),
|
403
|
+
select: () => elm.select(),
|
404
|
+
setCustomValidity: (message) => elm.setCustomValidity(message),
|
405
|
+
reportValidity: () => elm.reportValidity(),
|
406
|
+
};
|
402
407
|
}
|
403
408
|
},
|
404
409
|
},
|