File tree 2 files changed +25
-15
lines changed
packages/main/src/components/AnalyticalTable/ColumnHeader
2 files changed +25
-15
lines changed Original file line number Diff line number Diff line change 32
32
}
33
33
34
34
.text {
35
+ cursor : pointer;
35
36
color : inherit;
36
37
font-family : inherit;
37
38
width : 100% ;
Original file line number Diff line number Diff line change @@ -94,11 +94,12 @@ export const ColumnHeader = (props: ColumnHeaderProps) => {
94
94
const [ popoverOpen , setPopoverOpen ] = useState ( false ) ;
95
95
const columnHeaderRef = useRef < HTMLDivElement > ( null ) ;
96
96
97
+ const childIsString = typeof children === 'string' ;
97
98
const tooltip = ( ( ) => {
98
99
if ( headerTooltip ) {
99
100
return headerTooltip ;
100
101
}
101
- if ( typeof children === 'string' ) {
102
+ if ( childIsString ) {
102
103
return children ;
103
104
}
104
105
return null ;
@@ -163,7 +164,7 @@ export const ColumnHeader = (props: ColumnHeaderProps) => {
163
164
className = { clsx ( classNames . thContainer , showVerticalEndBorder && classNames . verticalEndBorder ) }
164
165
style = { {
165
166
position : 'absolute' ,
166
- top : 0 ,
167
+ insetBlockStart : 0 ,
167
168
width : `${ virtualColumn . size } px` ,
168
169
...directionStyles
169
170
} }
@@ -197,19 +198,27 @@ export const ColumnHeader = (props: ColumnHeaderProps) => {
197
198
aria-sort = { ariaSort }
198
199
title = { title }
199
200
>
200
- < div className = { classNames . header } data-h-align = { column . hAlign } >
201
- < Text
202
- title = { tooltip }
203
- maxLines = { 1 }
204
- style = { textStyle }
205
- className = { clsx (
206
- classNames . text ,
207
- columnId === '__ui5wcr__internal_selection_column' && classNames . selectAllCheckBoxContainer
208
- ) }
209
- data-component-name = { `AnalyticalTableHeaderHeaderContentContainer-${ columnId } ` }
210
- >
211
- { children }
212
- </ Text >
201
+ < div
202
+ className = { clsx (
203
+ classNames . header ,
204
+ columnId === '__ui5wcr__internal_selection_column' && classNames . selectAllCheckBoxContainer
205
+ ) }
206
+ data-h-align = { column . hAlign }
207
+ data-component-name = { `AnalyticalTableHeaderContentContainer-${ columnId } ` }
208
+ >
209
+ { childIsString ? (
210
+ < Text
211
+ title = { tooltip }
212
+ maxLines = { 1 }
213
+ style = { textStyle }
214
+ className = { classNames . text }
215
+ data-component-name = { `AnalyticalTableHeaderTextContentContainer-${ columnId } ` }
216
+ >
217
+ { children }
218
+ </ Text >
219
+ ) : (
220
+ children
221
+ ) }
213
222
< div
214
223
className = { classNames . iconContainer }
215
224
data-component-name = { `AnalyticalTableHeaderIconsContainer-${ columnId } ` }
You can’t perform that action at this time.
0 commit comments