Skip to content

Fix contest highlight bug when page changes#53

Open
AdityaBVerma wants to merge 1 commit intobinbard:mainfrom
AdityaBVerma:fix/contest-highlight-bug
Open

Fix contest highlight bug when page changes#53
AdityaBVerma wants to merge 1 commit intobinbard:mainfrom
AdityaBVerma:fix/contest-highlight-bug

Conversation

@AdityaBVerma
Copy link
Contributor

Fix: Friend highlight persists across contest ranking pages (#48)

What was happening

When switching pages in the contest rankings, friend highlights sometimes carried over to the next or previous page.
This happened because LeetCode reuses table rows and the previously applied inline styles were never cleared.

What I changed

I added a small cleanup step before applying highlights:

  • A new clearHighlights() function removes any existing highlight styles
  • It runs at the start of action() so each page starts fresh

Result

  • Highlights now appear only on pages where the friend is actually present
  • Moving back and forth between pages no longer leaves stale highlights
Screen.Recording.2026-01-14.170046.mp4

Fixes #48

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Highlight persists on the next and previous page

1 participant