diff --git a/src/libs/Navigation/NavigationRoot.tsx b/src/libs/Navigation/NavigationRoot.tsx index 06a3dce8d59a..9e1eb348451b 100644 --- a/src/libs/Navigation/NavigationRoot.tsx +++ b/src/libs/Navigation/NavigationRoot.tsx @@ -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 (