New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

react-best-gradient-color-picker

Package Overview
Dependencies
Maintainers
1
Versions
247
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-best-gradient-color-picker - npm Package Compare versions

Comparing version 1.4.7 to 1.4.8

12

lib/index.js
import React, { useRef, useState, useEffect } from "react";
import { useScrollPosition } from 'react-use-scroll-position';
import { useWindowSizes } from 'react-use-window-sizes';
import PickerContextWrapper from './context';

@@ -18,6 +17,2 @@ import Picker from "./Picker";

const contRef = useRef(null);
const {
width,
height
} = useWindowSizes();
const [bounds, setBounds] = useState(passedBounds || {});

@@ -28,8 +23,9 @@ const {

} = useScrollPosition();
const boundingRect = contRef?.current?.getBoundingClientRect();
useEffect(() => {
if (!passedBounds) {
setBounds(contRef?.current?.getBoundingClientRect());
setTimeout(() => setBounds(contRef?.current?.getBoundingClientRect()), 150);
setBounds(boundingRect);
setTimeout(() => setBounds(boundingRect), 150);
}
}, [width, height, x, y]);
}, [boundingRect, x, y]);
return /*#__PURE__*/React.createElement("div", {

@@ -36,0 +32,0 @@ ref: contRef

{
"name": "react-best-gradient-color-picker",
"version": "1.4.7",
"version": "1.4.8",
"description": "An easy to use color/gradient picker for React.js",

@@ -48,5 +48,4 @@ "main": "lib/index.js",

"tinycolor2": "^1.4.2",
"react-use-scroll-position": "^2.0.0",
"react-use-window-sizes": "^1.0.3"
"react-use-scroll-position": "^2.0.0"
}
}
import React, { useRef, useState, useEffect } from "react"
import { useScrollPosition } from 'react-use-scroll-position';
import { useWindowSizes } from 'react-use-window-sizes';
import PickerContextWrapper from './context';

@@ -11,12 +10,12 @@ import Picker from "./Picker";

const contRef = useRef(null);
const { width, height } = useWindowSizes();
const [bounds, setBounds] = useState(passedBounds || {});
const { x, y } = useScrollPosition();
const boundingRect = contRef?.current?.getBoundingClientRect();
useEffect(() => {
if (!passedBounds) {
setBounds(contRef?.current?.getBoundingClientRect())
setTimeout(() => setBounds(contRef?.current?.getBoundingClientRect()), 150)
setBounds(boundingRect)
setTimeout(() => setBounds(boundingRect), 150)
}
}, [width, height, x, y])
}, [boundingRect, x, y])

@@ -23,0 +22,0 @@ return (

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