File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -178,15 +178,22 @@ export function initTabs() {
178178
179179 const newHeight = $wrap . height ( ) ;
180180
181- $wrap . css ( 'height' , currentHeight ) ;
182- gsap . to ( $wrap , {
183- height : newHeight ,
184- duration : 0.4 ,
185- ease : 'power2.out' ,
186- onComplete : ( ) => {
187- $wrap . css ( 'height' , 'auto' ) ;
188- } ,
189- } ) ;
181+ const computedHeight = window . getComputedStyle ( $wrap [ 0 ] ) . height ;
182+ const inlineHeight = $wrap [ 0 ] . style . height ;
183+
184+ if ( ! inlineHeight ) {
185+ $wrap . css ( 'height' , currentHeight ) ;
186+ gsap . to ( $wrap , {
187+ height : newHeight ,
188+ duration : 0.4 ,
189+ ease : 'power2.out' ,
190+ onComplete : ( ) => {
191+ $wrap . attr ( 'style' , '' ) ;
192+ } ,
193+ } ) ;
194+ } else {
195+ $wrap . css ( 'height' , 'auto' ) ;
196+ }
190197
191198 if ( $targetContent . is ( 'ul, ol, li' ) ) {
192199 const $items = $targetContent . find ( 'li' ) . add ( '[data-tabs="content-item"]' ) ;
You can’t perform that action at this time.
0 commit comments