webmail: when quoting text that switches unicode blocks (as highlighted), don't lose the switched text

by using a String object as the textarea child.  instead of a regular js string
that would be unicode-block-switch-highlighted, which would cause it to be
split into parts, with odd or even parts added as span elements, which the
textarea would then ignore.
This commit is contained in:
Mechiel Lukkien
2023-10-14 14:47:24 +02:00
parent a40f5a5eb3
commit 56956c224b
5 changed files with 27 additions and 3 deletions

View File

@ -1427,7 +1427,9 @@ const compose = (opts: ComposeOptions) => {
),
),
body=dom.textarea(dom._class('mono'), attr.rows('15'), style({width: '100%'}),
opts.body || '',
// Explicit string object so it doesn't get the highlight-unicode-block-changes
// treatment, which would cause characters to disappear.
new String(opts.body || ''),
opts.body && !opts.isForward && !opts.body.startsWith('\n\n') ? prop({selectionStart: opts.body.length, selectionEnd: opts.body.length}) : [],
function keyup(e: KeyboardEvent) {
if (e.key === 'Enter') {