File tree Expand file tree Collapse file tree 1 file changed +17
-1
lines changed Expand file tree Collapse file tree 1 file changed +17
-1
lines changed Original file line number Diff line number Diff line change @@ -95,8 +95,13 @@ class TableLayout {
95
95
this . appendHeight = appendWrapper ? appendWrapper . offsetHeight : 0 ;
96
96
97
97
if ( this . showHeader && ! headerWrapper ) return ;
98
+
99
+ // fix issue (https://github.com/ElemeFE/element/pull/16956)
100
+ const headerTrElm = headerWrapper . querySelector ( '.el-table__header tr' ) ;
101
+ const noneHeader = this . headerDisplayNone ( headerTrElm ) ;
102
+
98
103
const headerHeight = this . headerHeight = ! this . showHeader ? 0 : headerWrapper . offsetHeight ;
99
- if ( this . showHeader && headerWrapper . offsetWidth > 0 && ( this . table . columns || [ ] ) . length > 0 && headerHeight < 2 ) {
104
+ if ( this . showHeader && ! noneHeader && headerWrapper . offsetWidth > 0 && ( this . table . columns || [ ] ) . length > 0 && headerHeight < 2 ) {
100
105
return Vue . nextTick ( ( ) => this . updateElsHeight ( ) ) ;
101
106
}
102
107
const tableHeight = this . tableHeight = this . table . $el . clientHeight ;
@@ -113,6 +118,17 @@ class TableLayout {
113
118
this . notifyObservers ( 'scrollable' ) ;
114
119
}
115
120
121
+ headerDisplayNone ( elm ) {
122
+ let headerChild = elm ;
123
+ while ( headerChild . tagName !== 'DIV' ) {
124
+ if ( getComputedStyle ( headerChild ) . display === 'none' ) {
125
+ return true ;
126
+ }
127
+ headerChild = headerChild . parentElement ;
128
+ }
129
+ return false ;
130
+ }
131
+
116
132
updateColumnsWidth ( ) {
117
133
if ( Vue . prototype . $isServer ) return ;
118
134
const fit = this . fit ;
You can’t perform that action at this time.
0 commit comments