Skip to content

Commit

Permalink
fix: should prefer custom target
Browse files Browse the repository at this point in the history
  • Loading branch information
JounQin committed Aug 8, 2023
1 parent c5ba896 commit 3fc3714
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/back-top/back-top.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ export class BackTopComponent {

getTarget(target: TargetType): Element | Window {
const scrollTarget =
(typeof target === 'string' && document.querySelector(target)) ||
(typeof target === 'string' ? document.querySelector(target) : target) ||
this.cdkScrollable?.getElementRef().nativeElement ||
window;
this._scrollTarget = scrollTarget;
Expand Down

0 comments on commit 3fc3714

Please sign in to comment.