(docs-site) 🐛 Fix the cursor position auto-reset while typing in progress#5922
Merged
martijnrusschen merged 1 commit intoHacker0x01:mainfrom Oct 14, 2025
Merged
Conversation
- Resolved the cursor position reset issue while typing in progress
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #5922 +/- ##
=======================================
Coverage 97.29% 97.29%
=======================================
Files 30 30
Lines 3470 3470
Branches 1473 1457 -16
=======================================
Hits 3376 3376
Misses 94 94 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Removed the
debouncein thedocs-siteexample editor soreact-liveno longer resets the cursor position while typing. This ensures smooth, predictable typing behavior in the live code editor.Problem
As a part of enabling the support for TypeScript examples in the
docs-site, we makereact-liveto be a controlled component so that we can able to use the updated code for JSX transpilation when user switches to the JavaScript tab. We debounceonChangehandler. But withdebounceenabled,react-liveoccasionally re-renders out of sync during typing, which auto-resets the cursor/selection position mid-input.Changes
debouncefrom the example editor’sonChangehandling in docs-site/src/components/Example/index.tsx.Screenshots
The issue
https://github.com/user-attachments/assets/d8d0d6b5-7838-4213-af69-c7356161b7a7
After the fix
https://github.com/user-attachments/assets/a1965261-b2fc-4e84-97e5-715f60cd34de
Contribution checklist