mirror of
https://github.com/shoelace-style/webawesome.git
synced 2026-01-12 20:19:13 +00:00
fix indicator animation bug
This commit is contained in:
@@ -73,7 +73,6 @@ export default class SlTabGroup extends ShoelaceElement {
|
||||
super.connectedCallback();
|
||||
|
||||
this.resizeObserver = new ResizeObserver(() => {
|
||||
this.preventIndicatorTransition();
|
||||
this.repositionIndicator();
|
||||
this.updateScrollControls();
|
||||
});
|
||||
@@ -344,17 +343,6 @@ export default class SlTabGroup extends ShoelaceElement {
|
||||
}
|
||||
}
|
||||
|
||||
// In some orientations, when the component is resized, the indicator's position will change causing it to animate
|
||||
// while you resize. Calling this method will prevent the transition from running on resize, which feels more natural.
|
||||
preventIndicatorTransition() {
|
||||
const transitionValue = this.indicator.style.transition;
|
||||
this.indicator.style.transition = 'none';
|
||||
|
||||
requestAnimationFrame(() => {
|
||||
this.indicator.style.transition = transitionValue;
|
||||
});
|
||||
}
|
||||
|
||||
// This stores tabs and panels so we can refer to a cache instead of calling querySelectorAll() multiple times.
|
||||
syncTabsAndPanels() {
|
||||
this.tabs = this.getAllTabs({ includeDisabled: false });
|
||||
|
||||
Reference in New Issue
Block a user