fix: only resize section when it is the active panel

This commit is contained in:
alistair3149 2023-07-28 02:43:26 -04:00 committed by GitHub
parent 819b55a93d
commit 54166529cb
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -119,8 +119,12 @@ function initTabber( tabber, count ) {
const onElementResize = function ( entries ) {
if ( entries && entries.length > 0 ) {
const targetPanel = entries[ 0 ].target;
const section = targetPanel.parentNode;
updateSectionHeight( section, targetPanel );
/* Only update section height when it is the current active tab */
if ( targetPanel.getAttribute( 'aria-hidden' ) === false ) {
const section = targetPanel.parentNode;
updateSectionHeight( section, targetPanel );
}
}
};