Skip to content

Commit

Permalink
fix(back-top): should prefer custom target (#490)
Browse files Browse the repository at this point in the history
  • Loading branch information
JounQin authored Aug 8, 2023
1 parent c5ba896 commit 3a3aefa
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
5 changes: 5 additions & 0 deletions .changeset/rich-dots-divide.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@alauda/ui": patch
---

fix(back-top): should prefer custom target
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 3a3aefa

Please sign in to comment.