File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1010 :maxlength =" 1000"
1111 :user-data =" members"
1212 @submit =" submit" />
13+ <NcButton v-show =" hasContent"
14+ type =" tertiary"
15+ :aria-label =" t('deck', 'Submit')"
16+ :title =" t('deck', 'Submit')"
17+ class =" comment-form__submit"
18+ @click =" submit" >
19+ <template #icon >
20+ <ArrowRightIcon :size =" 20" />
21+ </template >
22+ </NcButton >
1323 <p v-if =" error" >
1424 {{ error }}
1525 </p >
1828
1929<script >
2030import { mapState } from ' vuex'
21- import { NcRichContenteditable } from ' @nextcloud/vue'
31+ import { NcButton , NcRichContenteditable } from ' @nextcloud/vue'
32+ import ArrowRightIcon from ' vue-material-design-icons/ArrowRight.vue'
2233
2334export default {
2435 name: ' CommentForm' ,
2536 components: {
37+ ArrowRightIcon,
38+ NcButton,
2639 NcRichContenteditable,
2740 },
2841 props: {
@@ -53,6 +66,9 @@ export default {
5366 })
5467 return obj
5568 },
69+ hasContent () {
70+ return this .commentText .trim ().length > 0
71+ },
5672 },
5773 watch: {
5874 value (val ) {
@@ -98,4 +114,20 @@ export default {
98114 [class *= " _tribute-container-autocomplete_" ] {
99115 z-index : 9999 !important ;
100116 }
117+
118+ .comment-form {
119+ position : relative ;
120+
121+ .comment-form__submit {
122+ position : absolute ;
123+ bottom : var (--default-grid-baseline );
124+ inset-inline-end : var (--default-grid-baseline );
125+ z-index : 1 ;
126+ }
127+
128+ // Add padding to prevent text from going under the button
129+ :deep (.rich-content-editor__input ) {
130+ padding-inline-end : calc (var (--default-clickable-area ) + var (--default-grid-baseline ));
131+ }
132+ }
101133 </style >
Original file line number Diff line number Diff line change @@ -183,9 +183,7 @@ export default {
183183 },
184184 showUpdateForm () {
185185 this .edit = true
186- this .$nextTick (() => {
187- this .commentMsg = this .$refs .richTextElement .children [0 ].innerHTML
188- })
186+ this .commentMsg = this .comment .message
189187 },
190188 hideUpdateForm () {
191189 this .commentMsg = ' '
You can’t perform that action at this time.
0 commit comments