|
68 | 68 | </div> |
69 | 69 |
|
70 | 70 | <!-- Message editor --> |
71 | | - <div v-if="editor || editing" class="comment__editor "> |
72 | | - <NcRichContenteditable ref="editor" |
73 | | - :auto-complete="autoComplete" |
74 | | - :contenteditable="!loading" |
75 | | - :value="localMessage" |
76 | | - :user-data="userData" |
77 | | - @update:value="updateLocalMessage" |
78 | | - @submit="onSubmit" /> |
79 | | - <NcButton class="comment__submit" |
80 | | - type="tertiary-no-background" |
81 | | - native-type="submit" |
82 | | - :aria-label="t('comments', 'Post comment')" |
83 | | - :disabled="isEmptyMessage" |
84 | | - @click="onSubmit"> |
85 | | - <template #icon> |
86 | | - <span v-if="loading" class="icon-loading-small" /> |
87 | | - <ArrowRight v-else :size="20" /> |
88 | | - </template> |
89 | | - </NcButton> |
90 | | - </div> |
| 71 | + |
| 72 | + <form v-if="editor || editing" class="comment__editor" @submit.prevent> |
| 73 | + <div class="comment__editor-group"> |
| 74 | + <NcRichContenteditable ref="editor" |
| 75 | + :placeholder="t('comments', 'Write a message …')" |
| 76 | + :auto-complete="autoComplete" |
| 77 | + :contenteditable="!loading" |
| 78 | + :value="localMessage" |
| 79 | + :user-data="userData" |
| 80 | + aria-describedby="tab-comments__editor-description" |
| 81 | + @update:value="updateLocalMessage" |
| 82 | + @submit="onSubmit" /> |
| 83 | + <div class="comment__submit"> |
| 84 | + <NcButton type="tertiary-no-background" |
| 85 | + native-type="submit" |
| 86 | + :aria-label="t('comments', 'Post comment')" |
| 87 | + :disabled="isEmptyMessage" |
| 88 | + @click="onSubmit"> |
| 89 | + <template #icon> |
| 90 | + <span v-if="loading" class="icon-loading-small" /> |
| 91 | + <ArrowRight v-else :size="20" /> |
| 92 | + </template> |
| 93 | + </NcButton> |
| 94 | + </div> |
| 95 | + </div> |
| 96 | + <div id="tab-comments__editor-description" class="comment__editor-description"> |
| 97 | + {{ t('comments', '"@" for mentions, ":" for emoji, "/" for smart picker') }} |
| 98 | + </div> |
| 99 | + </form> |
91 | 100 |
|
92 | 101 | <!-- Message content --> |
93 | 102 | <!-- The html is escaped and sanitized before rendering --> |
@@ -279,6 +288,14 @@ $comment-padding: 10px; |
279 | 288 | padding-top: 16px; |
280 | 289 | } |
281 | 290 |
|
| 291 | + &__editor-group { |
| 292 | + position: relative; |
| 293 | + } |
| 294 | + &__editor-description { |
| 295 | + color: var(--color-text-maxcontrast); |
| 296 | + padding-block: var(--default-grid-baseline); |
| 297 | + } |
| 298 | +
|
282 | 299 | &__body { |
283 | 300 | display: flex; |
284 | 301 | flex-grow: 1; |
@@ -312,10 +329,8 @@ $comment-padding: 10px; |
312 | 329 |
|
313 | 330 | &__submit { |
314 | 331 | position: absolute !important; |
315 | | - right: 0; |
316 | 332 | bottom: 0; |
317 | | - // Align with input border |
318 | | - margin: 1px; |
| 333 | + right: 0; |
319 | 334 | } |
320 | 335 |
|
321 | 336 | &__message { |
|
0 commit comments