@bobfrankston/rmfmail 1.1.237 → 1.1.239
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/client/compose/compose.bundle.js +10 -15
- package/client/compose/compose.bundle.js.map +2 -2
- package/client/compose/compose.js +15 -3
- package/client/compose/compose.js.map +1 -1
- package/client/compose/compose.ts +15 -2
- package/client/compose/spellcheck.js +20 -15
- package/client/compose/spellcheck.js.map +1 -1
- package/client/compose/spellcheck.ts +20 -14
- package/package.json +1 -1
|
@@ -536,23 +536,29 @@ function showSuggestionsMenu(
|
|
|
536
536
|
}, 0);
|
|
537
537
|
}
|
|
538
538
|
|
|
539
|
-
/** Replace a misspelling marker span with the correction.
|
|
540
|
-
*
|
|
541
|
-
*
|
|
539
|
+
/** Replace a misspelling marker span with the correction.
|
|
540
|
+
*
|
|
541
|
+
* Uses TinyMCE's own selection + insertContent API, which focuses the editor
|
|
542
|
+
* iframe, replaces the selection, and registers on the undo stack.
|
|
543
|
+
*
|
|
544
|
+
* The previous implementation called `doc.execCommand("insertText")` directly
|
|
545
|
+
* on the iframe document. That silently failed: the suggestions popup lives in
|
|
546
|
+
* the TOP document (showSuggestionsMenu(document, …)), so clicking a suggestion
|
|
547
|
+
* moves focus OUT of the editor iframe — and Chromium/WebView2 `execCommand` on
|
|
548
|
+
* an UNFOCUSED contenteditable returns `true` while doing nothing. Because it
|
|
549
|
+
* returned truthy, the raw-DOM fallback never ran either, so the correction was
|
|
550
|
+
* simply dropped (Bob 2026-06-11: "spelling corrections not getting applied").
|
|
551
|
+
* editor.focus() + editor.selection.select() makes the replacement land. */
|
|
542
552
|
function replaceMarker(editor: any, marker: HTMLElement, replacement: string): void {
|
|
543
|
-
const doc: Document = editor.getDoc();
|
|
544
|
-
const range = doc.createRange();
|
|
545
|
-
range.selectNode(marker);
|
|
546
|
-
const sel = doc.getSelection();
|
|
547
|
-
if (!sel) return;
|
|
548
|
-
sel.removeAllRanges();
|
|
549
|
-
sel.addRange(range);
|
|
550
553
|
try {
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
}
|
|
554
|
+
editor.focus();
|
|
555
|
+
editor.selection.select(marker);
|
|
556
|
+
editor.insertContent(editor.dom.encode(replacement));
|
|
555
557
|
} catch {
|
|
558
|
+
// Raw-DOM fallback if the editor API is unavailable for any reason.
|
|
559
|
+
const doc: Document = editor.getDoc();
|
|
560
|
+
const range = doc.createRange();
|
|
561
|
+
range.selectNode(marker);
|
|
556
562
|
range.deleteContents();
|
|
557
563
|
range.insertNode(doc.createTextNode(replacement));
|
|
558
564
|
}
|