Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion api-goldens/element-ng/common/index.api.md
Original file line number Diff line number Diff line change
Expand Up @@ -235,7 +235,7 @@ export const responsivelyCheckDirection: (params: {
close: boolean;
};

// @public
// @public @deprecated
export class ScrollbarHelper {
readonly width: number;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,11 @@ import { inject, Injectable, DOCUMENT } from '@angular/core';
/**
* Gets the width of the scrollbar. Nesc for windows
* http://stackoverflow.com/a/13382873/888165
*
* @deprecated This service uses a legacy DOM-measurement hack to determine scrollbar width.
* Use `element.offsetWidth - element.clientWidth` on the scrollable element directly,
* which is more accurate, SSR-safe, and accounts for OS-level theming and CSS overrides.
* Will be removed in v52.
*/
@Injectable({ providedIn: 'root' })
export class ScrollbarHelper {
Expand Down
5 changes: 2 additions & 3 deletions projects/element-ng/dashboard/si-dashboard.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ import {
viewChild
} from '@angular/core';
import { outputToObservable, takeUntilDestroyed } from '@angular/core/rxjs-interop';
import { ScrollbarHelper } from '@siemens/element-ng/common';
import {
BOOTSTRAP_BREAKPOINTS,
ElementDimensions,
Expand Down Expand Up @@ -104,7 +103,6 @@ export class SiDashboardComponent implements OnChanges, AfterViewInit {
private scroller = inject(ViewportScroller);
private dashboardService = inject(SiDashboardService);
private resizeObserver = inject(ResizeObserverService);
private scrollbarHelper = inject(ScrollbarHelper);
private cdRef = inject(ChangeDetectorRef);
private document = inject(DOCUMENT);
private injector = inject(Injector);
Expand Down Expand Up @@ -285,7 +283,8 @@ export class SiDashboardComponent implements OnChanges, AfterViewInit {
dashboardFrameDimensions &&
dashboardDimensions.height > dashboardFrameDimensions.height
) {
padding = padding - this.scrollbarHelper.width;
const { offsetWidth, clientWidth } = this.dashboardFrame().nativeElement;
padding = padding - (offsetWidth - clientWidth);
Comment thread
chintankavathia marked this conversation as resolved.
}
this.dashboardFrameEndPadding.set(padding);
}
Expand Down
Loading