Merge branch 'fix/additionalInputboxHeightUpdates' into 'develop'
Fix/additional inputbox height updates See merge request pleroma/pleroma-fe!235
This commit is contained in:
commit
8a7ed79fd3
@ -28,6 +28,9 @@ const PostStatusForm = {
|
||||
components: {
|
||||
MediaUpload
|
||||
},
|
||||
mounted () {
|
||||
this.resize(this.$refs.textarea)
|
||||
},
|
||||
data () {
|
||||
let statusText = ''
|
||||
|
||||
@ -235,10 +238,11 @@ const PostStatusForm = {
|
||||
e.dataTransfer.dropEffect = 'copy'
|
||||
},
|
||||
resize (e) {
|
||||
e.target.style.height = 'auto'
|
||||
e.target.style.height = `${e.target.scrollHeight - 10}px`
|
||||
if (e.target.value === '') {
|
||||
e.target.style.height = '16px'
|
||||
const target = e.target || e
|
||||
target.style.height = 'auto'
|
||||
target.style.height = `${target.scrollHeight - 10}px`
|
||||
if (target.value === '') {
|
||||
target.style.height = '16px'
|
||||
}
|
||||
},
|
||||
clearError () {
|
||||
|
@ -2,7 +2,22 @@
|
||||
<div class="post-status-form">
|
||||
<form @submit.prevent="postStatus(newStatus)">
|
||||
<div class="form-group" >
|
||||
<textarea @click="setCaret" @keyup="setCaret" v-model="newStatus.status" :placeholder="$t('post_status.default')" rows="1" class="form-control" @keydown.down="cycleForward" @keydown.up="cycleBackward" @keydown.shift.tab="cycleBackward" @keydown.tab="cycleForward" @keydown.enter="replaceCandidate" @keydown.meta.enter="postStatus(newStatus)" @keyup.ctrl.enter="postStatus(newStatus)" @drop="fileDrop" @dragover.prevent="fileDrag" @input="resize" @paste="paste"></textarea>
|
||||
<textarea
|
||||
ref="textarea"
|
||||
@click="setCaret"
|
||||
@keyup="setCaret" v-model="newStatus.status" :placeholder="$t('post_status.default')" rows="1" class="form-control"
|
||||
@keydown.down="cycleForward"
|
||||
@keydown.up="cycleBackward"
|
||||
@keydown.shift.tab="cycleBackward"
|
||||
@keydown.tab="cycleForward"
|
||||
@keydown.enter="replaceCandidate"
|
||||
@keydown.meta.enter="postStatus(newStatus)"
|
||||
@keyup.ctrl.enter="postStatus(newStatus)"
|
||||
@drop="fileDrop"
|
||||
@dragover.prevent="fileDrag"
|
||||
@input="resize"
|
||||
@paste="paste">
|
||||
</textarea>
|
||||
</div>
|
||||
<div style="position:relative;" v-if="candidates">
|
||||
<div class="autocomplete-panel">
|
||||
|
Loading…
Reference in New Issue
Block a user