mirror of
https://github.com/hoppscotch/hoppscotch.git
synced 2026-04-26 01:06:00 +03:00
[PR #4138] [MERGED] fix: large content scroll bug in codemirror editor #4678
Labels
No labels
CodeDay
a11y
browser limited
bug
bug fix
cli
core
critical
design
desktop
discussion
docker
documentation
duplicate
enterprise
feature
feature
fosshack
future
good first issue
hacktoberfest
help wanted
i18n
invalid
major
minor
need information
need testing
not applicable to hoppscotch
not reproducible
pull-request
question
refactor
resolved
sandbox
self-host
spam
stale
testmu
wip
wont fix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/hoppscotch#4678
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/hoppscotch/hoppscotch/pull/4138
Author: @nivedin
Created: 6/20/2024
Status: ✅ Merged
Merged: 6/21/2024
Merged by: @AndrewBastin
Base:
patch← Head:fix/codemirror-large-text-scroll-bug📝 Commits (3)
4a70142fix: huge code scroll bug in codemirror238bc22chore: scroll inside codemirror for response lensesd51f137chore: add overflow for container📊 Changes
3 files changed (+8 additions, -4 deletions)
View changed files
📝
packages/hoppscotch-common/src/components/lenses/renderers/JSONLensRenderer.vue(+2 -1)📝
packages/hoppscotch-common/src/components/lenses/renderers/RawLensRenderer.vue(+2 -2)📝
packages/hoppscotch-common/src/composables/codemirror.ts(+4 -1)📄 Description
Closes #4050, #4007
https://github.com/hoppscotch/hoppscotch/assets/53208152/38d7d4c9-dad1-4c29-ba90-0481f035fe8c
This PR fixes the issue in CodeMirror where content was not loading correctly on scroll when we had large request bodies. Parts of the body were not rendered and would only render when clicked.
4106 fixes the issue, but the CodeMirror component was not filling the parent container. Therefore, a hack fix
view.requestMeasure()is used. This function re-measures the CodeMirror layout.What's changed
Added a function inside the CodeMirror scroll listener that re-measures the CodeMirror layout while scrolling.
Also added CodeMirror scroll for response lenses.
Notes to reviewers
To check the bug, select the option application/json from the body content-type and paste a large text. Scroll down and you should be able to see the content without clicking the editor.
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.