Comparing version 3.0.1 to 3.0.2
@@ -42,3 +42,3 @@ function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } | ||
if (autoFocus && !disabled) { | ||
if (autoFocus && !disabled && mergedRef.current) { | ||
mergedRef.current.focus(); | ||
@@ -53,3 +53,3 @@ } | ||
var setInternalChecked = function setInternalChecked(checked, e) { | ||
var setInternalChecked = function setInternalChecked(isChecked, e) { | ||
var disabled = props.disabled, | ||
@@ -63,7 +63,7 @@ onChange = props.onChange; | ||
if (!('checked' in props)) { | ||
setChecked(checked); | ||
setChecked(isChecked); | ||
} | ||
if (onChange) { | ||
onChange(checked, e); | ||
onChange(isChecked, e); | ||
} | ||
@@ -94,3 +94,5 @@ }; | ||
var handleMouseUp = function handleMouseUp(e) { | ||
mergedRef.current.blur(); | ||
if (mergedRef.current) { | ||
mergedRef.current.blur(); | ||
} | ||
@@ -97,0 +99,0 @@ if (props.onMouseUp) { |
@@ -59,3 +59,3 @@ "use strict"; | ||
if (autoFocus && !disabled) { | ||
if (autoFocus && !disabled && mergedRef.current) { | ||
mergedRef.current.focus(); | ||
@@ -70,3 +70,3 @@ } | ||
var setInternalChecked = function setInternalChecked(checked, e) { | ||
var setInternalChecked = function setInternalChecked(isChecked, e) { | ||
var disabled = props.disabled, | ||
@@ -80,7 +80,7 @@ onChange = props.onChange; | ||
if (!('checked' in props)) { | ||
setChecked(checked); | ||
setChecked(isChecked); | ||
} | ||
if (onChange) { | ||
onChange(checked, e); | ||
onChange(isChecked, e); | ||
} | ||
@@ -111,3 +111,5 @@ }; | ||
var handleMouseUp = function handleMouseUp(e) { | ||
mergedRef.current.blur(); | ||
if (mergedRef.current) { | ||
mergedRef.current.blur(); | ||
} | ||
@@ -114,0 +116,0 @@ if (props.onMouseUp) { |
{ | ||
"name": "rc-switch", | ||
"version": "3.0.1", | ||
"version": "3.0.2", | ||
"description": "switch ui component for react", | ||
@@ -32,3 +32,3 @@ "keywords": [ | ||
"gh-pages": "father doc deploy", | ||
"prepublishOnly": "npm run compile && np --no-cleanup --yolo --no-publish", | ||
"prepublishOnly": "npm run compile && np --yolo --no-publish --any-branch", | ||
"lint": "eslint .", | ||
@@ -35,0 +35,0 @@ "test": "father test", |
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
24169
377