Skip to content
Snippets Groups Projects

IssueNotes: Resize comment form after note submit and discard.

Merged Fatih Acet requested to merge acet-fix-comment-form-resize into master
2 files
+ 22
0
Compare changes
  • Side-by-side
  • Inline
Files
2
@@ -2,6 +2,7 @@
/* global Flash, Autosave */
import { mapActions, mapGetters } from 'vuex';
import _ from 'underscore';
import autosize from 'vendor/autosize';
import '../../autosave';
import TaskList from '../../task_list';
import * as constants from '../constants';
@@ -124,6 +125,7 @@
}
this.isSubmitting = true;
this.note = ''; // Empty textarea while being requested. Repopulate in catch
this.resizeTextarea();
this.saveNote(noteData)
.then((res) => {
@@ -174,6 +176,7 @@
if (shouldClear) {
this.note = '';
this.resizeTextarea();
}
// reset autostave
@@ -205,6 +208,11 @@
selector: '.notes',
});
},
resizeTextarea() {
this.$nextTick(() => {
autosize.update(this.$refs.textarea);
});
},
},
mounted() {
// jQuery is needed here because it is a custom event being dispatched with jQuery.
Loading