From 333d5fbd097076642b64adc108194c330e5a1c32 Mon Sep 17 00:00:00 2001 From: Neil Jenkins Date: Wed, 17 Jul 2024 15:18:27 +1000 Subject: [PATCH] Remove ZWS and parent empty inlines on blur Resolves #461 --- source/Editor.ts | 3 +++ 1 file changed, 3 insertions(+) diff --git a/source/Editor.ts b/source/Editor.ts index e0403bd..78762bb 100644 --- a/source/Editor.ts +++ b/source/Editor.ts @@ -156,6 +156,9 @@ class Squire { this.addEventListener('touchstart', this._disableRestoreSelection); this.addEventListener('focus', this._restoreSelection); + // On blur, cleanup any ZWS/empty inlines + this.addEventListener('blur', this._removeZWS); + // Clipboard support this._isShiftDown = false; this.addEventListener('cut', _onCut as (e: Event) => void);