react-hook-form 7.26.1 → 7.27.0
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 +3 -2
- 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/logic/createFormControl.d.ts.map +1 -1
- package/dist/types/fieldArray.d.ts +6 -6
- package/dist/types/fieldArray.d.ts.map +1 -1
- package/dist/types/form.d.ts +7 -3
- package/dist/types/form.d.ts.map +1 -1
- package/dist/useFieldArray.d.ts.map +1 -1
- package/package.json +2 -2
package/dist/index.esm.mjs
CHANGED
@@ -1972,9 +1972,10 @@ function createFormControl(props = {}) {
|
|
1972
1972
|
isSubmitSuccessful: false,
|
1973
1973
|
});
|
1974
1974
|
};
|
1975
|
-
const setFocus = (name) => {
|
1975
|
+
const setFocus = (name, options = {}) => {
|
1976
1976
|
const field = get(_fields, name)._f;
|
1977
|
-
|
1977
|
+
const fieldRef = field.refs ? field.refs[0] : field.ref;
|
1978
|
+
options.shouldSelect ? fieldRef.select() : fieldRef.focus();
|
1978
1979
|
};
|
1979
1980
|
return {
|
1980
1981
|
control: {
|