File tree Expand file tree Collapse file tree 1 file changed +15
-3
lines changed
packages/core/src/components/SimpleStyleScrollables Expand file tree Collapse file tree 1 file changed +15
-3
lines changed Original file line number Diff line number Diff line change @@ -37,12 +37,24 @@ export default function useSplitContentContainerStyles(
3737 contentContainerStyleNames
3838 ) ;
3939
40- // contentContainerStyle should always at least fill the parent to ensure sizing changes reflects properly on component and children
40+ const leftBorderWidth =
41+ flattenedStyle . borderLeftWidth ?? flattenedStyle . borderWidth ?? 0 ;
42+ const rightBorderWidth =
43+ flattenedStyle . borderRightWidth ?? flattenedStyle . borderWidth ?? 0 ;
44+ const topBorderWidth =
45+ flattenedStyle . borderTopWidth ?? flattenedStyle . borderWidth ?? 0 ;
46+ const bottomBorderWidth =
47+ flattenedStyle . borderBottomWidth ?? flattenedStyle . borderWidth ?? 0 ;
48+
49+ // contentContainerStyle should always at least fill the parent to ensure sizing changes reflects properly on component and children.
50+ // The measured sizes include borders, so we need to subtract those before applying
4151 if ( measuredWidth ) {
42- contentContainerStyle . minWidth = measuredWidth ;
52+ contentContainerStyle . minWidth =
53+ measuredWidth - leftBorderWidth - rightBorderWidth ;
4354 }
4455 if ( measuredHeight ) {
45- contentContainerStyle . minHeight = measuredHeight ;
56+ contentContainerStyle . minHeight =
57+ measuredHeight - topBorderWidth - bottomBorderWidth ;
4658 }
4759
4860 let style = omit ( flattenedStyle , contentContainerStyleNames ) ;
You can’t perform that action at this time.
0 commit comments