From eda71383301068896f23c510fb5b46c4c41ee148 Mon Sep 17 00:00:00 2001 From: yinonov Date: Thu, 29 Dec 2022 09:51:11 +0200 Subject: [PATCH] =?UTF-8?q?add=20missing=20part=20attribute=20for=20tabpan?= =?UTF-8?q?el=20in=20tabs=20component=20(#6543)=20 # Pull Request ## 📖 Description ### 🎫 Issues ## 👩‍💻 Reviewer Notes ## 📑 Test Plan ## ✅ Checklist ### General - [ ] I have included a change request file using `$ yarn change` - [ ] I have added tests for my changes. - [ ] I have tested my changes. - [ ] I have updated the project documentation to reflect my changes. - [ ] I have read the [CONTRIBUTING](https://github.com/microsoft/fast/blob/master/CONTRIBUTING.md) documentation and followed the [standards](/docs/community/code-of-conduct/#our-standards) for this project. ### Component-specific - [ ] I have added a new component - [ ] I have modified an existing component - [ ] I have updated the [definition file](https://github.com/microsoft/fast/blob/master/packages/web-components/fast-components/CONTRIBUTING.md#definition) - [ ] I have updated the [configuration file](https://github.com/microsoft/fast/blob/master/packages/web-components/fast-components/CONTRIBUTING.md#configuration) ## ⏭ Next Steps --- packages/web-components/fast-foundation/src/tabs/tabs.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/packages/web-components/fast-foundation/src/tabs/tabs.ts b/packages/web-components/fast-foundation/src/tabs/tabs.ts index 2a7625ff44b..b0a3f3b93a3 100644 --- a/packages/web-components/fast-foundation/src/tabs/tabs.ts +++ b/packages/web-components/fast-foundation/src/tabs/tabs.ts @@ -345,7 +345,8 @@ export class Tabs extends FoundationElement { const prev: number = this.activeIndicatorRef[offsetProperty]; this.activeIndicatorRef.style[gridProperty] = `${this.activeTabIndex + 1}`; const next: number = this.activeIndicatorRef[offsetProperty]; - this.activeIndicatorRef.style[gridProperty] = `${this.prevActiveTabIndex + 1}`; + const gridPropertyValue = this.prevActiveTabIndex === -1 ? 0 : this.prevActiveTabIndex; + this.activeIndicatorRef.style[gridProperty] = `${gridPropertyValue + 1}`; const dif: number = next - prev; this.activeIndicatorRef.style.transform = `${translateProperty}(${dif}px)`; this.activeIndicatorRef.classList.add("activeIndicatorTransition");