Merged PR 1966: Adjustments for #5320, #5360, #5361

Adjustments for #5320, #5360, #5361
This commit is contained in:
Nino Righi
2025-10-06 19:02:45 +00:00
committed by Lorenz Hilpert
parent 15a4718e58
commit a086111ab5
9 changed files with 72 additions and 74 deletions

View File

@@ -11,8 +11,6 @@ import { IconButtonComponent } from '@isa/ui/buttons';
import { toObservable, toSignal } from '@angular/core/rxjs-interop';
import { debounceTime, fromEvent, switchMap } from 'rxjs';
export type ScrollTopPosition = { bottom?: string; right?: string };
@Component({
selector: 'utils-scroll-top-button',
imports: [IconButtonComponent],
@@ -20,9 +18,6 @@ export type ScrollTopPosition = { bottom?: string; right?: string };
template: `
@if (display()) {
<button
[style.position]="isTargetElement() ? 'absolute' : 'fixed'"
[style.bottom]="position().bottom ?? defaultPosition.bottom"
[style.right]="position().right ?? defaultPosition.right"
uiIconButton
aria-label="Scroll to top"
type="button"
@@ -41,12 +36,6 @@ export type ScrollTopPosition = { bottom?: string; right?: string };
changeDetection: ChangeDetectionStrategy.OnPush,
})
export class ScrollTopButtonComponent {
/** The default position of the button. */
defaultPosition: ScrollTopPosition = { bottom: '1.5rem', right: '1.5rem' };
/** The position of the button. */
position = input<ScrollTopPosition>(this.defaultPosition);
/** The scroll target, either `window` or a specific element. */
target = input<Window | HTMLElement>(window);