react-hook-form
Advanced tools
Comparing version 0.1.5 to 0.1.6
@@ -185,20 +185,12 @@ import { useRef, useState, useEffect } from 'react'; | ||
return; | ||
const eventAttached = options[radioOptionIndex].eventAttached; | ||
if (eventAttached) { | ||
removeAllEventListeners(ref, validateWithStateUpdate); | ||
} | ||
else { | ||
if (!options[radioOptionIndex].eventAttached) { | ||
options[radioOptionIndex].ref.addEventListener(isOnChange ? 'change' : 'blur', validateWithStateUpdate); | ||
options[radioOptionIndex].eventAttached = true; | ||
} | ||
options[radioOptionIndex].eventAttached = !eventAttached; | ||
} | ||
else { | ||
const eventAttached = field.eventAttached; | ||
if (eventAttached) { | ||
removeAllEventListeners(ref, validateWithStateUpdate); | ||
} | ||
else { | ||
if (!field.eventAttached) { | ||
ref.addEventListener(isOnChange ? 'input' : 'blur', validateWithStateUpdate); | ||
field.eventAttached = true; | ||
} | ||
field.eventAttached = !eventAttached; | ||
} | ||
@@ -205,0 +197,0 @@ } |
@@ -187,20 +187,12 @@ 'use strict'; | ||
return; | ||
const eventAttached = options[radioOptionIndex].eventAttached; | ||
if (eventAttached) { | ||
removeAllEventListeners(ref, validateWithStateUpdate); | ||
} | ||
else { | ||
if (!options[radioOptionIndex].eventAttached) { | ||
options[radioOptionIndex].ref.addEventListener(isOnChange ? 'change' : 'blur', validateWithStateUpdate); | ||
options[radioOptionIndex].eventAttached = true; | ||
} | ||
options[radioOptionIndex].eventAttached = !eventAttached; | ||
} | ||
else { | ||
const eventAttached = field.eventAttached; | ||
if (eventAttached) { | ||
removeAllEventListeners(ref, validateWithStateUpdate); | ||
} | ||
else { | ||
if (!field.eventAttached) { | ||
ref.addEventListener(isOnChange ? 'input' : 'blur', validateWithStateUpdate); | ||
field.eventAttached = true; | ||
} | ||
field.eventAttached = !eventAttached; | ||
} | ||
@@ -207,0 +199,0 @@ } |
{ | ||
"name": "react-hook-form", | ||
"version": "0.1.5", | ||
"version": "0.1.6", | ||
"main": "dist/index.js", | ||
@@ -5,0 +5,0 @@ "module": "dist/index.es.js", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
33503
756