File tree Expand file tree Collapse file tree
components/dash-core-components/src Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -110,7 +110,7 @@ const DatePickerRange = ({
110110 // Capture CSS variables for portal mode
111111 const portalStyle = useMemo ( ( ) => {
112112 return hasPortal ? captureCSSForPortal ( containerRef ) : undefined ;
113- } , [ hasPortal ] ) ;
113+ } , [ hasPortal , isCalendarOpen ] ) ;
114114
115115 useEffect ( ( ) => {
116116 setInternalStartDate ( strAsDate ( start_date ) ) ;
Original file line number Diff line number Diff line change @@ -25,11 +25,15 @@ export function captureCSSForPortal(
2525 }
2626
2727 // Capture key inherited properties
28- const inheritedProps = [ 'fontFamily ' , 'fontSize ' , 'color' ] ;
28+ const inheritedProps = [ 'font-family ' , 'font-size ' , 'color' ] ;
2929 inheritedProps . forEach ( prop => {
3030 const value = computedStyle . getPropertyValue ( prop ) ;
3131 if ( value ) {
32- styles [ prop ] = value ;
32+ // Convert hyphenated CSS property names to camelCase for React
33+ const camelCaseProp = prop . replace ( / - ( [ a - z ] ) / g, ( _ , letter ) =>
34+ letter . toUpperCase ( )
35+ ) ;
36+ styles [ camelCaseProp ] = value ;
3337 }
3438 } ) ;
3539
You can’t perform that action at this time.
0 commit comments