@@ -7,6 +7,7 @@ import { watch } from '../../internal/watch.js';
7
7
import componentStyles from '../../styles/component.styles.js' ;
8
8
import ShoelaceElement from '../../internal/shoelace-element.js' ;
9
9
import SlIconButton from '../icon-button/icon-button.component.js' ;
10
+ import SlResizeObserver from '../resize-observer/resize-observer.component.js' ;
10
11
import styles from './tab-group.styles.js' ;
11
12
import type { CSSResultGroup } from 'lit' ;
12
13
import type SlTab from '../tab/tab.js' ;
@@ -42,7 +43,7 @@ import type SlTabPanel from '../tab-panel/tab-panel.js';
42
43
*/
43
44
export default class SlTabGroup extends ShoelaceElement {
44
45
static styles : CSSResultGroup = [ componentStyles , styles ] ;
45
- static dependencies = { 'sl-icon-button' : SlIconButton } ;
46
+ static dependencies = { 'sl-icon-button' : SlIconButton , 'sl-resize-observer' : SlResizeObserver } ;
46
47
47
48
private readonly localize = new LocalizeController ( this ) ;
48
49
@@ -437,7 +438,9 @@ export default class SlTabGroup extends ShoelaceElement {
437
438
< div class ="tab-group__nav ">
438
439
< div part ="tabs " class ="tab-group__tabs " role ="tablist ">
439
440
< div part ="active-tab-indicator " class ="tab-group__indicator "> </ div >
440
- < slot name ="nav " @slotchange =${ this . syncTabsAndPanels } > </ slot >
441
+ < sl-resize-observer @sl-resize =${ this . syncIndicator } >
442
+ < slot name ="nav " @slotchange =${ this . syncTabsAndPanels } > </ slot >
443
+ </ sl-resize-observer >
441
444
</ div >
442
445
</ div >
443
446
0 commit comments