@bobfrankston/rmfmail 1.2.24 → 1.2.25
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/lib/rmf-tiny.js
CHANGED
|
@@ -265,8 +265,25 @@ export async function createTinyMceEditor(container, opts = {}) {
|
|
|
265
265
|
const applyZoom = () => {
|
|
266
266
|
try {
|
|
267
267
|
const body = ed.getBody();
|
|
268
|
-
if (body)
|
|
269
|
-
|
|
268
|
+
if (!body)
|
|
269
|
+
return;
|
|
270
|
+
body.style.fontSize = `${zoomPx}px`;
|
|
271
|
+
// WebView2's native spell-check markers are laid out ONCE
|
|
272
|
+
// (at the initial 14px) and do NOT reposition when the
|
|
273
|
+
// font-size changes via inline style — they stay stranded
|
|
274
|
+
// at the old, smaller baseline, so the red squiggle draws
|
|
275
|
+
// ABOVE the now-larger words instead of under them (Bob
|
|
276
|
+
// 2026-06-17 "red squiggle on the row above the text").
|
|
277
|
+
// Toggling the spellcheck attribute off→on forces the
|
|
278
|
+
// engine to re-run + re-place the markers at the current
|
|
279
|
+
// font metrics. rAF lets the font-size reflow land first.
|
|
280
|
+
const win = (ed.getWin && ed.getWin()) || window;
|
|
281
|
+
const raf = win.requestAnimationFrame || ((f) => setTimeout(f, 16));
|
|
282
|
+
body.setAttribute("spellcheck", "false");
|
|
283
|
+
raf(() => { try {
|
|
284
|
+
body.setAttribute("spellcheck", "true");
|
|
285
|
+
}
|
|
286
|
+
catch { /* */ } });
|
|
270
287
|
}
|
|
271
288
|
catch { /* */ }
|
|
272
289
|
};
|