Skip to content

Commit f2572eb

Browse files
authored
Merge pull request #40294 from nextcloud/fix/37087/new-comment-description
fix(comments): move new comment instructions placeholder to description
2 parents 5979651 + 0ce5a34 commit f2572eb

File tree

4 files changed

+45
-29
lines changed

4 files changed

+45
-29
lines changed

apps/comments/src/components/Comment.vue

Lines changed: 37 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -68,26 +68,33 @@
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+
<form v-if="editor || editing" class="comment__editor" @submit.prevent>
72+
<div class="comment__editor-group">
73+
<NcRichContenteditable ref="editor"
74+
:auto-complete="autoComplete"
75+
:contenteditable="!loading"
76+
:value="localMessage"
77+
:user-data="userData"
78+
aria-describedby="tab-comments__editor-description"
79+
@update:value="updateLocalMessage"
80+
@submit="onSubmit" />
81+
<div class="comment__submit">
82+
<NcButton type="tertiary-no-background"
83+
native-type="submit"
84+
:aria-label="t('comments', 'Post comment')"
85+
:disabled="isEmptyMessage"
86+
@click="onSubmit">
87+
<template #icon>
88+
<span v-if="loading" class="icon-loading-small" />
89+
<ArrowRight v-else :size="20" />
90+
</template>
91+
</NcButton>
92+
</div>
93+
</div>
94+
<div id="tab-comments__editor-description" class="comment__editor-description">
95+
{{ t('comments', '"@" for mentions, ":" for emoji, "/" for smart picker') }}
96+
</div>
97+
</form>
9198

9299
<!-- Message content -->
93100
<!-- The html is escaped and sanitized before rendering -->
@@ -273,7 +280,6 @@ $comment-padding: 10px;
273280
.comment {
274281
display: flex;
275282
gap: 16px;
276-
position: relative;
277283
padding: 5px $comment-padding;
278284
279285
&__side {
@@ -313,12 +319,19 @@ $comment-padding: 10px;
313319
color: var(--color-text-maxcontrast);
314320
}
315321
322+
&__editor-group {
323+
position: relative;
324+
}
325+
326+
&__editor-description {
327+
color: var(--color-text-maxcontrast);
328+
padding-block: var(--default-grid-baseline);
329+
}
330+
316331
&__submit {
317332
position: absolute !important;
318-
right: 0;
319333
bottom: 0;
320-
// Align with input border
321-
margin: 1px;
334+
right: 0;
322335
}
323336
324337
&__message {

apps/comments/src/views/Comments.vue

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

316316
<style lang="scss" scoped>
317317
.comments {
318-
// Do not add emptycontent top margin
318+
min-height: 100%;
319+
display: flex;
320+
flex-direction: column;
321+
319322
&__empty,
320323
&__error {
321-
margin-top: 0 !important;
324+
flex: 1 0;
322325
}
323326
324327
&__retry {

dist/comments-comments-app.js

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/comments-comments-app.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)