reactjs / reactjs/react.dev

[Bug]: Code editor not displaying code when scrolling

Open
#6,997 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug: unconfirmed
Dominant language
JavaScript
Stars
11.8k
Forks
7.9k
Avg merge
1d 11h
Merged PRs (30d)
11

Description

Summary

When I scroll in a code sample editor, sometimes the lines are blank and nothing is rendered (pictures attached below). I can force the code to render if I click in the code editor, or navigate to a new tab and then come back.

Page

Any page that there is a code editor, (the images are from https://react.dev/learn/preserving-and-resetting-state)

Details

The image below shows what it looks like when I scroll in a code editor. Nothing past line 36 is displayed.

image

When I click the code editor, the lines become visible.

image

I have tried to find a pattern for when this occurs, but to me, it seems mostly random (and happens maybe 5% of the time).

I am using Google Chrome Version 126.0.6478.127.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the issue in the code editor on the preserving-and-resetting-state page using Chrome, then compare scrolling with clicking the editor or navigating away and back. Trace the editor entry point used across pages and verify that code remains rendered while scrolling without requiring focus or navigation.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, react
Domain
documentation, frontend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
42/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.