Skip to content

Commit 13543ff

Browse files
authored
Merge pull request #44171 from nextcloud/backport/40294/stable27
[stable27] fix(comments): move new comment instructions placeholder to description
2 parents d0f63c9 + 9f6d13e commit 13543ff

File tree

4 files changed

+46
-28
lines changed

4 files changed

+46
-28
lines changed

apps/comments/src/components/Comment.vue

Lines changed: 38 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -68,26 +68,35 @@
6868
</div>
6969

7070
<!-- 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>
91100

92101
<!-- Message content -->
93102
<!-- The html is escaped and sanitized before rendering -->
@@ -279,6 +288,14 @@ $comment-padding: 10px;
279288
padding-top: 16px;
280289
}
281290
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+
282299
&__body {
283300
display: flex;
284301
flex-grow: 1;
@@ -312,10 +329,8 @@ $comment-padding: 10px;
312329
313330
&__submit {
314331
position: absolute !important;
315-
right: 0;
316332
bottom: 0;
317-
// Align with input border
318-
margin: 1px;
333+
right: 0;
319334
}
320335
321336
&__message {

apps/comments/src/views/Comments.vue

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -299,10 +299,13 @@ export default {
299299

300300
<style lang="scss" scoped>
301301
.comments {
302-
// Do not add emptycontent top margin
302+
min-height: 100%;
303+
display: flex;
304+
flex-direction: column;
305+
303306
&__empty,
304307
&__error {
305-
margin-top: 0 !important;
308+
flex: 1 0;
306309
}
307310
308311
&__retry {

0 commit comments

Comments
 (0)