File tree Expand file tree Collapse file tree 1 file changed +7
-3
lines changed
Expand file tree Collapse file tree 1 file changed +7
-3
lines changed Original file line number Diff line number Diff line change @@ -42,9 +42,12 @@ export const Overview = (pr: PullRequest) => {
4242 return ;
4343 }
4444
45+ // Initially ensure title is not stuck
46+ title . classList . remove ( 'stuck' ) ;
47+
4548 // Use IntersectionObserver to detect when the title becomes sticky
4649 // The sentinel is positioned right before the title
47- // When sentinel is fully scrolled out of view (past the top), title becomes stuck
50+ // When sentinel scrolls out of view (past the top), title becomes stuck
4851 const observer = new IntersectionObserver (
4952 ( [ entry ] ) => {
5053 // When sentinel is intersecting (visible), title is NOT stuck
@@ -56,8 +59,9 @@ export const Overview = (pr: PullRequest) => {
5659 }
5760 } ,
5861 {
59- // No rootMargin - just detect when sentinel leaves viewport naturally
60- threshold : [ 0 ]
62+ // Use threshold 1 to only trigger when sentinel is fully visible/invisible
63+ // This prevents false positives when sentinel is partially visible
64+ threshold : [ 1 ]
6165 }
6266 ) ;
6367
You can’t perform that action at this time.
0 commit comments