5858 <label class =" hidden-visually" for =" form-desc" >
5959 {{ t('forms', 'Description') }}
6060 </label >
61- <NcRichContenteditable id =" form-desc"
61+ <textarea id =" form-desc"
62+ ref =" description"
6263 class =" form-desc form-desc__input"
6364 :value =" form.description"
64- :multiline =" true"
6565 :placeholder =" t('forms', 'Description (formatting using Markdown is supported)')"
6666 :maxlength =" maxStringLengths.formDescription"
67- @update:value =" updateDescription" />
67+ @input =" updateDescription" />
6868 </template >
6969 <!-- eslint-disable-next-line vue/no-v-html -->
7070 <div v-else class =" form-desc form-desc__output" v-html =" formDescription" />
@@ -142,7 +142,6 @@ import NcActions from '@nextcloud/vue/dist/Components/NcActions.js'
142142import NcAppContent from ' @nextcloud/vue/dist/Components/NcAppContent.js'
143143import NcEmptyContent from ' @nextcloud/vue/dist/Components/NcEmptyContent.js'
144144import NcLoadingIcon from ' @nextcloud/vue/dist/Components/NcLoadingIcon.js'
145- import NcRichContenteditable from ' @nextcloud/vue/dist/Components/NcRichContenteditable.js'
146145import IconPlus from ' vue-material-design-icons/Plus.vue'
147146
148147import answerTypes from ' ../models/AnswerTypes.js'
@@ -168,7 +167,6 @@ export default {
168167 NcAppContent,
169168 NcEmptyContent,
170169 NcLoadingIcon,
171- NcRichContenteditable,
172170 Question,
173171 QuestionLong,
174172 QuestionShort,
@@ -284,24 +282,34 @@ export default {
284282
285283 enableEdit () {
286284 this .edit = true
285+ this .resizeDescription ()
287286 },
288287
289288 initEdit () {
290289 if (this .form .title ) {
291290 this .edit = false
292291 } else {
293292 this .edit = true
293+ this .resizeDescription ()
294294 }
295295 },
296296
297+ resizeDescription () {
298+ // nextTick to ensure textarea is attached to DOM
299+ this .$nextTick (() => {
300+ const rows = this .$refs .description .value .split (' \n ' ).length
301+ this .$refs .description .setAttribute (' rows' , rows)
302+ })
303+ },
304+
297305 /**
298306 * Update the description
299307 *
300- * @param {string} value New description
308+ * @param {InputEvent} ev The input event of the textarea
301309 */
302- updateDescription (value = ' ' ) {
303- // We need this for nextcloud/nextcloud-vue#3669
304- this .form . description = value . trimEnd ()
310+ updateDescription ({ target } ) {
311+ this . form . description = target . value
312+ this .resizeDescription ()
305313 this .saveDescription ()
306314 },
307315
@@ -485,6 +493,7 @@ export default {
485493
486494 & __input {
487495 padding : 3px 14px 18px ; // 2px smaller because of border
496+ resize : none ;
488497 }
489498
490499 // Styling for rendered Output
0 commit comments