react-hook-form 7.46.1 → 7.46.2

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.
@@ -76,6 +76,8 @@ var get = (obj, path, defaultValue) => {
76
76
  : result;
77
77
  };
78
78
 
79
+ var isBoolean = (value) => typeof value === 'boolean';
80
+
79
81
  const EVENTS = {
80
82
  BLUR: 'blur',
81
83
  FOCUS_OUT: 'focusout',
@@ -444,7 +446,7 @@ function useController(props) {
444
446
  field: {
445
447
  name,
446
448
  value,
447
- disabled,
449
+ ...(isBoolean(disabled) ? { disabled } : {}),
448
450
  onChange: React.useCallback((event) => _registerProps.current.onChange({
449
451
  target: {
450
452
  value: getEventValue(event),
@@ -701,8 +703,6 @@ var updateFieldArrayRootError = (errors, error, name) => {
701
703
  return errors;
702
704
  };
703
705
 
704
- var isBoolean = (value) => typeof value === 'boolean';
705
-
706
706
  var isFileInput = (element) => element.type === 'file';
707
707
 
708
708
  var isFunction = (value) => typeof value === 'function';
@@ -1908,7 +1908,7 @@ function createFormControl(props = {}, flushRootRender) {
1908
1908
  else {
1909
1909
  error = (await validateField(field, _formValues, shouldDisplayAllAssociatedErrors, _options.shouldUseNativeValidation))[name];
1910
1910
  isFieldValueUpdated =
1911
- isNaN(fieldValue) ||
1911
+ Number.isNaN(fieldValue) ||
1912
1912
  fieldValue === get(_formValues, name, fieldValue);
1913
1913
  if (isFieldValueUpdated) {
1914
1914
  if (error) {