Skip to content

Commit

Permalink
Missed a needed change.
Browse files Browse the repository at this point in the history
  • Loading branch information
atmgrifter00 committed Oct 17, 2024
1 parent 0566358 commit 355aac2
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 9 deletions.
10 changes: 2 additions & 8 deletions packages/nimble-components/src/anchor-tabs/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -81,11 +81,6 @@ export class AnchorTabs extends FoundationElement {
*/
public readonly leftScrollButton!: Element;

/**
* @internal
*/
public readonly rightScrollButton!: Element;

private readonly tabListResizeObserver: ResizeObserver;
private tabIds: string[] = [];

Expand All @@ -94,11 +89,10 @@ export class AnchorTabs extends FoundationElement {
this.tabListResizeObserver = new ResizeObserver(entries => {
let tabListVisibleWidth = entries[0]?.contentRect.width;
if (tabListVisibleWidth !== undefined) {
const leftButtonWidth = this.leftScrollButton?.clientWidth ?? 0;
const rightButtonWidth = this.rightScrollButton?.clientWidth ?? 0;
const buttonWidth = this.leftScrollButton?.clientWidth ?? 0;
tabListVisibleWidth = Math.ceil(tabListVisibleWidth);
if (this.showScrollButtons) {
tabListVisibleWidth += leftButtonWidth + rightButtonWidth;
tabListVisibleWidth += (buttonWidth * 2);
}
this.showScrollButtons = tabListVisibleWidth < this.tablist.scrollWidth;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -490,7 +490,7 @@ describe('AnchorTabs', () => {
expect(tabsPageObject.areScrollButtonsVisible()).toBeTrue();
});

it('should hide scroll buttons when tab label is updated and tabs no longer overflow the container', async () => {
fit('should hide scroll buttons when tab label is updated and tabs no longer overflow the container', async () => {
await tabsPageObject.setTabsWidth(550);
await waitForUpdatesAsync(); // wait for the resize observer to fire
await tabsPageObject.addTab('New Tab With Extremely Long Name');
Expand Down

0 comments on commit 355aac2

Please sign in to comment.