Skip to content

Commit

Permalink
fix(NcRichContenteditable): reduce the cases where we have empty valu…
Browse files Browse the repository at this point in the history
…e but has one new line (browser dependent)

Signed-off-by: DorraJaouad <[email protected]>
  • Loading branch information
DorraJaouad authored and backportbot[bot] committed Nov 20, 2024
1 parent 04c077f commit efb6d43
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -766,7 +766,8 @@ export default {
* @param {string} htmlOrText the html content (or raw text with @mentions)
*/
updateValue(htmlOrText) {
const text = this.parseContent(htmlOrText)
// Browsers keep <br> after erasing contenteditable
const text = this.parseContent(htmlOrText).replace(/^\n$/, '')
this.localValue = text
this.$emit('update:modelValue', text)
},
Expand Down

0 comments on commit efb6d43

Please sign in to comment.