diff --git a/packages/mui-base/src/Tabs/TabIndicator/prehydrationScript.min.ts b/packages/mui-base/src/Tabs/TabIndicator/prehydrationScript.min.ts index da1bfed898..14dd44c60d 100644 --- a/packages/mui-base/src/Tabs/TabIndicator/prehydrationScript.min.ts +++ b/packages/mui-base/src/Tabs/TabIndicator/prehydrationScript.min.ts @@ -2,4 +2,4 @@ // To update it, modify the corresponding source file and run `pnpm inline-scripts`. // prettier-ignore -export const script = '!function(){console.log("prehydration");const t=document.currentScript.previousElementSibling;if(!t)return void console.log("no indicator");const o=t.closest(\'[role="tablist"]\');if(!o)return void console.log("no list");const e=o.querySelector(\'[data-selected="true"]\');if(!e)return void console.log("no active tab");const{left:n,right:i,top:r,bottom:l,width:c}=e.getBoundingClientRect(),{left:s,right:g,top:d,bottom:u,width:p}=o.getBoundingClientRect();if(0===c||0===p)return;const a=g-i,f=r-d,h=u-l,b=i-n,v=l-r;function m(o,e){t.style.setProperty(`--active-tab-${o}`,`${e}px`),console.log("setting prop",o,e,t)}m("left",n-s),m("right",a),m("top",f),m("bottom",h),m("width",b),m("height",v)}();'; +export const script = '!function(){const t=document.currentScript.previousElementSibling;if(!t)return;const e=t.closest(\'[role="tablist"]\');if(!e)return;const o=e.querySelector(\'[data-selected="true"]\');if(!o)return;const{left:i,right:n,top:r,bottom:c,width:l}=o.getBoundingClientRect(),{left:u,right:s,top:f,bottom:g,width:d}=e.getBoundingClientRect();if(0===l||0===d)return;const h=s-n,p=r-f,b=g-c,a=n-i,m=c-r;function w(e,o){t.style.setProperty(`--active-tab-${e}`,`${o}px`)}w("left",i-u),w("right",h),w("top",p),w("bottom",b),w("width",a),w("height",m)}();';