Skip to content

Commit

Permalink
Merge pull request #6860 from LedgerHQ/fix/LIVE-12568
Browse files Browse the repository at this point in the history
fix(lld): auto scroll when mounted on accounts page
  • Loading branch information
LucasWerey committed May 16, 2024
2 parents 8a065af + 1364fe0 commit 2e989ad
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 3 deletions.
5 changes: 5 additions & 0 deletions .changeset/nice-trains-dream.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"ledger-live-desktop": patch
---

fix automatic scroll that was triggered on accounts page when mounted
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,13 @@ const AccountRowItem = (props: Props) => {

const scrollTopFocusRef = useRef<HTMLSpanElement>(null);

const mountedRef = useRef(true);

useEffect(() => {
if (mountedRef.current) {
mountedRef.current = false;
return;
}
if (scrollTopFocusRef.current && !expanded) {
scrollTopFocusRef.current.scrollIntoView({
block: "nearest",
Expand All @@ -160,9 +166,7 @@ const AccountRowItem = (props: Props) => {
setExpanded(expandedStates[account.id]);
};

const onClickHandler = () => {
onClick(account, parentAccount);
};
const onClickHandler = () => onClick(account, parentAccount);

const unit = useAccountUnit(account);

Expand Down

0 comments on commit 2e989ad

Please sign in to comment.