Fix text box resizing (#750)

Closes #416
Closes #475
Closes #525
This commit is contained in:
triphora
2022-11-17 22:06:07 -05:00
committed by GitHub
parent 1738f92ce2
commit ddd3f7c196
4 changed files with 38 additions and 61 deletions

View File

@@ -752,6 +752,17 @@ tr.button-transparent {
} }
} }
.resizable-textarea-wrapper {
display: block;
textarea {
border-radius: var(--size-rounded-sm);
min-height: 10rem;
width: calc(100% - var(--spacing-card-lg) - var(--spacing-card-sm));
resize: vertical;
}
}
.error { .error {
display: flex; display: flex;
flex-direction: column; flex-direction: column;

View File

@@ -302,28 +302,26 @@
class="separator" class="separator"
:items="['source', 'preview']" :items="['source', 'preview']"
/> />
<div class="edit-wrapper"> <div v-if="bodyViewMode === 'source'" class="resizable-textarea-wrapper">
<div v-if="bodyViewMode === 'source'" class="textarea-wrapper"> <textarea
<textarea id="body"
id="body" v-model="newProject.body"
v-model="newProject.body" :class="{
:class="{ 'known-error': newProject.body === '' && showKnownErrors,
'known-error': newProject.body === '' && showKnownErrors, }"
}" :disabled="(currentMember.permissions & EDIT_BODY) !== EDIT_BODY"
:disabled="(currentMember.permissions & EDIT_BODY) !== EDIT_BODY" />
/>
</div>
<div
v-if="bodyViewMode === 'preview'"
v-highlightjs
class="markdown-body"
v-html="
newProject.body
? $xss($md.render(newProject.body))
: 'No body specified.'
"
></div>
</div> </div>
<div
v-if="bodyViewMode === 'preview'"
v-highlightjs
class="markdown-body"
v-html="
newProject.body
? $xss($md.render(newProject.body))
: 'No body specified.'
"
></div>
</section> </section>
<section class="card extra-links"> <section class="card extra-links">
<div class="title"> <div class="title">
@@ -812,17 +810,8 @@ label {
} }
} }
.textarea-wrapper { .resizable-textarea-wrapper textarea {
display: flex; min-height: 20rem;
flex-direction: column;
align-items: stretch;
textarea {
flex: 1;
overflow-y: auto;
resize: none;
max-width: 100%;
}
} }
.page-contents { .page-contents {
@@ -908,11 +897,6 @@ section.description {
margin: var(--spacing-card-sm) 0; margin: var(--spacing-card-sm) 0;
} }
.edit-wrapper * {
min-height: 10rem;
max-height: 40rem;
}
.markdown-body { .markdown-body {
overflow-y: auto; overflow-y: auto;
padding: 0 var(--spacing-card-sm); padding: 0 var(--spacing-card-sm);

View File

@@ -222,7 +222,7 @@
type="text" type="text"
placeholder="Enter the title..." placeholder="Enter the title..."
/> />
<div class="textarea-wrapper"> <div class="resizable-textarea-wrapper">
<textarea <textarea
id="body" id="body"
v-model="item.description" v-model="item.description"
@@ -652,10 +652,6 @@ export default {
border-radius: var(--size-rounded-sm); border-radius: var(--size-rounded-sm);
} }
.textarea-wrapper {
width: 100%;
}
input { input {
width: 100%; width: 100%;
margin: 0 0 0.25rem; margin: 0 0 0.25rem;

View File

@@ -175,13 +175,11 @@
class="separator" class="separator"
:items="['source', 'preview']" :items="['source', 'preview']"
/> />
<div v-if="changelogViewMode === 'source'" class="textarea-wrapper"> <div
<textarea v-if="changelogViewMode === 'source'"
id="body" class="resizable-textarea-wrapper"
v-model="version.changelog" >
class="changelog-textarea" <textarea id="body" v-model="version.changelog" spellcheck="true" />
spellcheck="true"
/>
</div> </div>
<div <div
v-if="changelogViewMode === 'preview'" v-if="changelogViewMode === 'preview'"
@@ -1304,18 +1302,6 @@ section {
margin-bottom: var(--spacing-card-sm); margin-bottom: var(--spacing-card-sm);
} }
.textarea-wrapper {
display: inline-block;
width: 100%;
}
.changelog-textarea {
resize: vertical;
width: calc(100% - var(--spacing-card-lg) - var(--spacing-card-md));
min-height: 10rem;
display: block;
}
.full-width-input { .full-width-input {
width: 100%; width: 100%;
margin-bottom: 0.5rem; margin-bottom: 0.5rem;