File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -143,6 +143,8 @@ export class MenulistTabElement extends HTMLElement {
143143
144144 if ( tab . active ) {
145145 this . tabButton . classList . add ( "active" ) ;
146+ // Scroll to center with a small delay to avoid initial render conflicts
147+ setTimeout ( ( ) => this . scrollIntoViewIfActive ( ) , 100 ) ;
146148 }
147149
148150 // https://qiita.com/piroor/items/44ccbc2ee918bc88c3ea
@@ -161,6 +163,14 @@ export class MenulistTabElement extends HTMLElement {
161163 this . tabMainElement . style . borderColor = displayedContainer . colorCode ;
162164 }
163165
166+ private scrollIntoViewIfActive ( ) : void {
167+ // Scroll the active tab into view at the center of the sidebar
168+ // Using requestAnimationFrame to ensure DOM is ready
169+ requestAnimationFrame ( ( ) => {
170+ this . scrollIntoView ( { behavior : 'smooth' , block : 'center' } ) ;
171+ } ) ;
172+ }
173+
164174 private getShadowElement ( id : string ) : HTMLElement {
165175 const element = this . shadowRoot ?. getElementById ( id ) ;
166176 if ( ! element ) {
Original file line number Diff line number Diff line change @@ -146,6 +146,7 @@ button:focus {
146146
147147# tab-button .active {
148148 font-weight : bold;
149+ box-shadow : inset 0 0 8px 2px rgba (0 , 150 , 255 , 0.4 );
149150}
150151
151152# tab-button : hover , # tab-button : focus {
You can’t perform that action at this time.
0 commit comments