Skip to content

Commit 7a3bb0f

Browse files
Merge pull request #7197 from nextcloud/backport/7128/stable30
[stable30] fix: make comments with mention editable
2 parents 125fb5b + b42ad7a commit 7a3bb0f

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

src/components/card/CommentForm.vue

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,12 @@ export default {
121121
// do it or not based on the next element instead of always
122122
// adding it.
123123
// FIXME user names can contain spaces, in that case they need to be wrapped @"user name" [a-zA-Z0-9\ _\.@\-']+
124-
const mentionValue = mention.firstElementChild.attributes['data-mention-id'].value
124+
let mentionValue
125+
if (mention.attributes['data-at-embedded'].value === 'true') {
126+
mentionValue = mention.parentNode.parentNode.querySelector('.user-bubble__wrapper').attributes['data-mention-id'].value
127+
} else {
128+
mentionValue = mention.firstChild.attributes['data-mention-id'].value
129+
}
125130
if (mentionValue.indexOf(' ') !== -1) {
126131
mention.replaceWith(' @"' + mentionValue + '" ')
127132
} else {

0 commit comments

Comments
 (0)