Skip to content

Commit

Permalink
Merge pull request #42961 from dominictb/fix/41197
Browse files Browse the repository at this point in the history
chore: remove all selection ranges during navigation
  • Loading branch information
amyevans authored Jun 7, 2024
2 parents 13fedce + e0e797f commit a9b15b1
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/libs/Navigation/NavigationRoot.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,11 @@ function NavigationRoot({authenticated, lastVisitedPath, initialUrl, onReady}: N

// We want to clean saved scroll offsets for screens that aren't anymore in the state.
cleanStaleScrollOffsets(state);

// clear all window selection on navigation
// this is to prevent the selection from persisting when navigating to a new page in web
// using "?" to avoid crash in native
window?.getSelection?.()?.removeAllRanges?.();
};

return (
Expand Down

0 comments on commit a9b15b1

Please sign in to comment.