From 007b022f3b7c7cfb9598635d163596f0c7e1debc Mon Sep 17 00:00:00 2001 From: Shmuel Leider Date: Thu, 1 Aug 2024 14:20:48 -0400 Subject: [PATCH] apply suggested changes --- src/components/tab-group/tab-group.component.ts | 5 +++-- src/components/tab-group/tab-group.styles.ts | 3 +-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/components/tab-group/tab-group.component.ts b/src/components/tab-group/tab-group.component.ts index f2c497a6..fee2708d 100644 --- a/src/components/tab-group/tab-group.component.ts +++ b/src/components/tab-group/tab-group.component.ts @@ -1,7 +1,8 @@ +import '../../internal/scrollend-polyfill.js'; import { classMap } from 'lit/directives/class-map.js'; +import { eventOptions, property, query, state } from 'lit/decorators.js'; import { html } from 'lit'; import { LocalizeController } from '../../utilities/localize.js'; -import { property, query, state } from 'lit/decorators.js'; import { scrollIntoView } from '../../internal/scroll.js'; import { watch } from '../../internal/watch.js'; import componentStyles from '../../styles/component.styles.js'; @@ -61,7 +62,6 @@ export default class SlTabGroup extends ShoelaceElement { @state() private hasScrollControls = false; @state() private shouldHideScrollStartButton = false; - @state() private shouldHideScrollEndButton = false; /** The placement of the tabs. */ @@ -378,6 +378,7 @@ export default class SlTabGroup extends ShoelaceElement { */ private scrollOffset = 1; + @eventOptions({ passive: true }) private updateScrollButtons() { if (this.hasScrollControls && this.autoHideScrollButtons) { this.shouldHideScrollStartButton = this.scrollFromStart() <= this.scrollOffset; diff --git a/src/components/tab-group/tab-group.styles.ts b/src/components/tab-group/tab-group.styles.ts index 1e34b0ca..4330bf47 100644 --- a/src/components/tab-group/tab-group.styles.ts +++ b/src/components/tab-group/tab-group.styles.ts @@ -33,8 +33,7 @@ export default css` .tab-group--has-scroll-controls .tab-group__scroll-button--start--hidden, .tab-group--has-scroll-controls .tab-group__scroll-button--end--hidden { - opacity: 0; - pointer-events: none; + visibility: hidden; } .tab-group__body {