react-hook-form 7.46.0 → 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,6 +446,7 @@ function useController(props) {
444
446
  field: {
445
447
  name,
446
448
  value,
449
+ ...(isBoolean(disabled) ? { disabled } : {}),
447
450
  onChange: React.useCallback((event) => _registerProps.current.onChange({
448
451
  target: {
449
452
  value: getEventValue(event),
@@ -700,8 +703,6 @@ var updateFieldArrayRootError = (errors, error, name) => {
700
703
  return errors;
701
704
  };
702
705
 
703
- var isBoolean = (value) => typeof value === 'boolean';
704
-
705
706
  var isFileInput = (element) => element.type === 'file';
706
707
 
707
708
  var isFunction = (value) => typeof value === 'function';
@@ -1907,7 +1908,7 @@ function createFormControl(props = {}, flushRootRender) {
1907
1908
  else {
1908
1909
  error = (await validateField(field, _formValues, shouldDisplayAllAssociatedErrors, _options.shouldUseNativeValidation))[name];
1909
1910
  isFieldValueUpdated =
1910
- isNaN(fieldValue) ||
1911
+ Number.isNaN(fieldValue) ||
1911
1912
  fieldValue === get(_formValues, name, fieldValue);
1912
1913
  if (isFieldValueUpdated) {
1913
1914
  if (error) {