You're Invited:Meet the Socket Team at BlackHat and DEF CON in Las Vegas, Aug 4-6.RSVP
Socket
Book a DemoInstallSign in
Socket

rc-util

Package Overview
Dependencies
Maintainers
9
Versions
217
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

rc-util - npm Package Compare versions

Comparing version

to
5.39.1

10

es/getScrollBarSize.js

@@ -28,6 +28,10 @@ /* eslint-disable no-param-reassign */

var webkitScrollbarStyle = getComputedStyle(ele, '::-webkit-scrollbar');
var width = parseInt(webkitScrollbarStyle.width, 10);
var height = parseInt(webkitScrollbarStyle.height, 10);
// Try wrap to handle CSP case
try {
updateCSS("\n #".concat(randomId, "::-webkit-scrollbar {\n width: ").concat(webkitScrollbarStyle.width, ";\n height: ").concat(webkitScrollbarStyle.height, ";\n }\n "), randomId);
var widthStyle = width ? "width: ".concat(webkitScrollbarStyle.width, ";") : '';
var heightStyle = height ? "height: ".concat(webkitScrollbarStyle.height, ";") : '';
updateCSS("\n#".concat(randomId, "::-webkit-scrollbar {\n").concat(widthStyle, "\n").concat(heightStyle, "\n}"), randomId);
} catch (e) {

@@ -38,4 +42,4 @@ // Can't wrap, just log error

// Get from style directly
fallbackWidth = parseInt(webkitScrollbarStyle.width, 10);
fallbackHeight = parseInt(webkitScrollbarStyle.height, 10);
fallbackWidth = width;
fallbackHeight = height;
}

@@ -42,0 +46,0 @@ }

@@ -36,6 +36,10 @@ "use strict";

var webkitScrollbarStyle = getComputedStyle(ele, '::-webkit-scrollbar');
var width = parseInt(webkitScrollbarStyle.width, 10);
var height = parseInt(webkitScrollbarStyle.height, 10);
// Try wrap to handle CSP case
try {
(0, _dynamicCSS.updateCSS)("\n #".concat(randomId, "::-webkit-scrollbar {\n width: ").concat(webkitScrollbarStyle.width, ";\n height: ").concat(webkitScrollbarStyle.height, ";\n }\n "), randomId);
var widthStyle = width ? "width: ".concat(webkitScrollbarStyle.width, ";") : '';
var heightStyle = height ? "height: ".concat(webkitScrollbarStyle.height, ";") : '';
(0, _dynamicCSS.updateCSS)("\n#".concat(randomId, "::-webkit-scrollbar {\n").concat(widthStyle, "\n").concat(heightStyle, "\n}"), randomId);
} catch (e) {

@@ -46,4 +50,4 @@ // Can't wrap, just log error

// Get from style directly
fallbackWidth = parseInt(webkitScrollbarStyle.width, 10);
fallbackHeight = parseInt(webkitScrollbarStyle.height, 10);
fallbackWidth = width;
fallbackHeight = height;
}

@@ -50,0 +54,0 @@ }

{
"name": "rc-util",
"version": "5.39.0",
"version": "5.39.1",
"description": "Common Utils For React Component",

@@ -5,0 +5,0 @@ "keywords": [