Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

rc-switch

Package Overview
Dependencies
Maintainers
5
Versions
34
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

rc-switch - npm Package Compare versions

Comparing version 3.0.1 to 3.0.2

12

es/index.js

@@ -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",

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc