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

react-slider

Package Overview
Dependencies
Maintainers
1
Versions
54
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-slider - npm Package Compare versions

Comparing version 0.3.3 to 0.3.4

2

package.json
{
"name": "react-slider",
"version": "0.3.3",
"version": "0.3.4",
"description": "Slider component for React",

@@ -5,0 +5,0 @@ "main": "react-slider.js",

@@ -43,2 +43,6 @@ (function (root, factory) {

function notNull(x) {
return x != null;
}
var ReactSlider = React.createClass({

@@ -120,19 +124,9 @@ displayName: 'ReactSlider',

// Check if the arity of `value` or `defaultValue` matches the number of children (= number of custom handles) and returns it.
// If no custom handles are provided, just returns `value` if present or `defaultValue` otherwise.
// If custom handles are present but neither `value` nor `defaultValue` are applicable the handles are spread out equally.
_or: function (value, defaultValue) {
var count = React.Children.count(this.props.children);
switch (count) {
case 0:
return value != null ? value : defaultValue;
case value.length:
return value;
case defaultValue.length:
return defaultValue;
default:
if (value.length !== count || defaultValue.length !== count) {
console.warn("ReactSlider: Number of values does not match number of children.");
}
return linspace(this.props.min, this.props.max, count);
if (value.every(notNull)) {
return value;
} else if (defaultValue.every(notNull)) {
return defaultValue
} else {
return linspace(this.props.min, this.props.max, React.Children.count(this.props.children));
}

@@ -248,3 +242,3 @@ },

'touchmove': this._onTouchMove,
'tochend': this._onTouchEnd
'touchend': this._onTouchEnd
}

@@ -265,3 +259,5 @@ },

return function (e) {
document.activeElement.blur();
if (document.activeElement) {
document.activeElement.blur();
}

@@ -524,3 +520,5 @@ var position = getPosition(e);

document.activeElement.blur();
if (document.activeElement) {
document.activeElement.blur();
}

@@ -527,0 +525,0 @@ var position = getPosition(e);

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