[PR #2850] [MERGED] fix: fix cursor going out of bounds when filtering response #4106

Closed
opened 2026-03-17 01:40:26 +03:00 by kerem · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/hoppscotch/hoppscotch/pull/2850
Author: @amk-dev
Created: 11/8/2022
Status: Merged
Merged: 11/9/2022
Merged by: @AndrewBastin

Base: mainHead: fix/invalid-position


📝 Commits (1)

  • 8f86f04 fix: make cursor update on all updates

📊 Changes

1 file changed (+10 additions, -12 deletions)

View changed files

📝 packages/hoppscotch-app/src/composables/codemirror.ts (+10 -12)

📄 Description

Before

The codemirror cursor value was going out of bounds when filtering a json response, causing an "Invalid Position" error.

  1. User sends a request
  2. Clicks somewhere on the response json
  3. toggles the filter
  4. filter the response json to some path
  5. in this case the cursor is not updated, but the content shrinks
  6. Invalid Position error

After

previously the cursor was only updated on an update on selectionSet. this PR changes it to update on all codemirror updates.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/hoppscotch/hoppscotch/pull/2850 **Author:** [@amk-dev](https://github.com/amk-dev) **Created:** 11/8/2022 **Status:** ✅ Merged **Merged:** 11/9/2022 **Merged by:** [@AndrewBastin](https://github.com/AndrewBastin) **Base:** `main` ← **Head:** `fix/invalid-position` --- ### 📝 Commits (1) - [`8f86f04`](https://github.com/hoppscotch/hoppscotch/commit/8f86f040aa80b6e2ac382790d1d7febbdd565665) fix: make cursor update on all updates ### 📊 Changes **1 file changed** (+10 additions, -12 deletions) <details> <summary>View changed files</summary> 📝 `packages/hoppscotch-app/src/composables/codemirror.ts` (+10 -12) </details> ### 📄 Description **Before** The codemirror cursor value was going out of bounds when filtering a json response, causing an "Invalid Position" error. 1. User sends a request 2. Clicks somewhere on the response json 3. toggles the filter 4. filter the response json to some path 5. in this case the cursor is not updated, but the content shrinks 6. Invalid Position error **After** previously the cursor was only updated on an update on selectionSet. this PR changes it to update on all codemirror updates. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
kerem 2026-03-17 01:40:26 +03:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/hoppscotch#4106
No description provided.