Skip to content

fix: preserve cursor position in JSON body editor#1574

Open
tejaswinisa1 wants to merge 1 commit intofoss42:mainfrom
tejaswinisa1:fix/request-body-typo
Open

fix: preserve cursor position in JSON body editor#1574
tejaswinisa1 wants to merge 1 commit intofoss42:mainfrom
tejaswinisa1:fix/request-body-typo

Conversation

@tejaswinisa1
Copy link
Copy Markdown

@tejaswinisa1 tejaswinisa1 commented Mar 30, 2026

PR Description

This PR fixes an issue in the JSON request body editor where typing in the middle of text could cause characters to appear in incorrect positions (e.g., "answer" becoming "anwe\nr").

The issue was caused by resetting the cursor position to the end on every widget update.

Related Issues

Checklist

  • I have gone through the contributing guide
  • I have updated my branch and synced it with project main branch before making this PR
  • I am using the latest Flutter stable branch
  • I have run the tests (flutter test) and all tests are passing

Added/updated tests?

  • Yes
  • No, and this is why: This change is limited to UI cursor behavior and does not affect business logic. The issue was verified manually through interaction in the JSON editor.

OS on which you have developed and tested the feature?

  • Windows
  • macOS
  • Linux

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.

1 participant