File tree Expand file tree Collapse file tree 1 file changed +4
-3
lines changed
Expand file tree Collapse file tree 1 file changed +4
-3
lines changed Original file line number Diff line number Diff line change @@ -10,7 +10,7 @@ type ExtendCSSStyleDeclaration = CSSStyleDeclaration & {
1010
1111let cached : ScrollBarSize ;
1212
13- function measureScrollbarSize ( ele ?: HTMLElement ) : ScrollBarSize {
13+ function measureScrollbarSize ( ele ?: HTMLElement , csp ?: { nonce ?: string } ) : ScrollBarSize {
1414 const randomId = `rc-scrollbar-measure-${ Math . random ( )
1515 . toString ( 36 )
1616 . substring ( 7 ) } `;
@@ -53,6 +53,7 @@ ${widthStyle}
5353${ heightStyle }
5454}` ,
5555 randomId ,
56+ { csp } ,
5657 ) ;
5758 } catch ( e ) {
5859 // Can't wrap, just log error
@@ -98,7 +99,7 @@ export default function getScrollBarSize(fresh?: boolean): number {
9899 return cached . width ;
99100}
100101
101- export function getTargetScrollBarSize ( target : HTMLElement ) {
102+ export function getTargetScrollBarSize ( target : HTMLElement , csp ?: { nonce ?: string } ) {
102103 if (
103104 typeof document === 'undefined' ||
104105 ! target ||
@@ -107,5 +108,5 @@ export function getTargetScrollBarSize(target: HTMLElement) {
107108 return { width : 0 , height : 0 } ;
108109 }
109110
110- return measureScrollbarSize ( target ) ;
111+ return measureScrollbarSize ( target , csp ) ;
111112}
You can’t perform that action at this time.
0 commit comments