mirror of
https://github.com/hoppscotch/hoppscotch.git
synced 2026-04-25 16:55:59 +03:00
[GH-ISSUE #970] response content doesn't fit to the text area when resizing #342
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#342
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?
Originally created by @ShahAnuj2610 on GitHub (Jul 2, 2020).
Original GitHub issue: https://github.com/hoppscotch/hoppscotch/issues/970
Originally assigned to: @ShahAnuj2610 on GitHub.
To Reproduce
Expected behavior
resizing should work properly
@liyasthomas commented on GitHub (Jul 2, 2020):
Seems like an issue with ace editor in large responses. Will look into it.
@ShahAnuj2610 commented on GitHub (Jul 2, 2020):
@liyasthomas you can assign to me. I can look into it.
@liyasthomas commented on GitHub (Jul 2, 2020):
Ahaa.. Great. Assigning this to you.
@ShahAnuj2610 commented on GitHub (Jul 4, 2020):
@liyasthomas after some debugging, I found this couple of things
Remove maxLines
We need to remove
maxLinesfrom heregithub.com/liyasthomas/postwoman@5d94ac361e/pages/index.vue (L998)and add height to parent divWhy?
ace-editoralways sets it's content according tomaxLineseditor.resize, it would resize to fit container according tomaxLinesAdd height to parent div
github.com/liyasthomas/postwoman@5d94ac361e/components/ui/ace-editor.vue (L2)Now whenever this
divgets resized, we need to calleditor.resize, so the content gets fitted according to the parentHow to detect resize on an element?
I found this library that could be used for
resizeevent change on an element https://github.com/Akryum/vue-resizeExample of ace-editor resize
https://codepen.io/ourcodeworld/embed/BaBXbPb?height=400&theme-id=dark&default-tab=js%2Cresult&user=ourcodeworld&slug-hash=BaBXbPb&pen-title=Resizable%20ACE%20Editor&name=cp_embed_1
Open question
If we remove
maxLines, then how to handleExpand Responsefeature. BC, currently we are settingmaxLines: infinityon expand responsegithub.com/liyasthomas/postwoman@5d94ac361e/pages/index.vue (L2478)Maybe sol'n
Calculate height according to this logic https://stackoverflow.com/questions/11584061/automatically-adjust-height-to-contents-in-ace-cloud-9-editor
Lmk, wdyt?
@liyasthomas commented on GitHub (Jul 4, 2020):
suggests to use
maxLines: Infinityto make editor expand to content height, so how can we removemaxLinesproperty?@ShahAnuj2610 commented on GitHub (Jul 5, 2020):
A possible sol'n could be to reset
maxLineswhenCollapse Response, and set it toInfinitywhenExpand Response. Although the above SO ans doesn't recommend to usemaxLines: Infinityas there could be performance issues. Instead we can set the viewport height of the parent to100vhand the parent's position would berelativeand editor's position would beabsolute@liyasthomas commented on GitHub (Jul 5, 2020):
Isn't this the current implementation? Frankly, I guess we can ignore this UI issue since it's only reproducible in such an edge case of large responses. Let me know if you can make a PR.