rc-util
Advanced tools
Comparing version 5.39.0 to 5.39.1
@@ -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": [ |
232831
7110
2