Skip to content

Commit

Permalink
fix(ui) Socket Panel > resized resizable payload input resets height …
Browse files Browse the repository at this point in the history
…every time you type in it or when a message comes in
  • Loading branch information
flawiddsouza committed Jan 20, 2025
1 parent 6995ad0 commit 4c21f24
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 7 deletions.
16 changes: 10 additions & 6 deletions packages/ui/src/components/SocketPanel.vue
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,8 @@
:allow-multiple-lines="true"
lang="json"
class="w-100p mt-0_5rem input o-a"
style="height: 5.8rem; resize: vertical; margin-bottom: 0.2rem;"
style="resize: vertical; margin-bottom: 0.2rem;"
v-initial-height
/>
<div class="d-f flex-jc-sb">
<button
Expand Down Expand Up @@ -725,6 +726,14 @@ async function setSelectedTextAsEnvironmentVariable() {
$toast.success(`Environment variable set: ${environmentVariableName}`)
}
const vInitialHeight = {
mounted(el: HTMLElement) {
if(!el.style.height) {
el.style.height = '5.8rem'
}
}
}
// Lifecycle Events
onBeforeMount(async() => {
Expand Down Expand Up @@ -938,7 +947,6 @@ button.icon > svg {
display: block;
}
textarea,
input,
select,
.input {
Expand All @@ -950,10 +958,6 @@ select,
background-color: var(--background-color);
}
textarea {
resize: vertical;
}
input:disabled, .input.disabled {
background-color: var(--socket-input-disabled-background-color);
}
Expand Down
4 changes: 3 additions & 1 deletion packages/ui/src/components/Tab.vue
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,9 @@
</section>

<section class="request-response-panels" v-if="collectionItem && collectionItem._type === 'socket'">
<SocketPanel :key="collectionItem._id" :active-tab="collectionItem" />
<KeepAlive>
<SocketPanel :key="collectionItem._id" :active-tab="collectionItem" />
</KeepAlive>
</section>

<section class="request-response-panels" v-show="collectionItem && collectionItem._type === 'request_group'">
Expand Down

0 comments on commit 4c21f24

Please sign in to comment.