a tool for shared writing and social publishing

Fix Android selection handle drag breaking selection state (#274) master

* Fix Android selection handle drag breaking selection state The highlightSelectionPlugin creates inline decorations (wrapping text in <span> elements) on every selection change. On Android, these DOM mutations during native selection handle drag cause the browser to lose track of the selection handles. Since these decorations are invisible when the editor is focused (via CSS), skip decoration updates for selection-only changes on Android to prevent the DOM mutations. https://claude.ai/code/session_01Qcv5Xm4QcDnzhWdTbfgQh9 * Skip selection-only decoration updates on all platforms The DOM mutations from updating inline decorations on selection changes are unnecessary since the decorations are invisible when the editor is focused via CSS. Removing the Android-only guard avoids the overhead everywhere. https://claude.ai/code/session_01Qcv5Xm4QcDnzhWdTbfgQh9 * Update decoration on blur so toolbar highlight still works The selection highlight needs to be visible when focus moves from the editor to the toolbar (e.g. for entering a link URL). Dispatch an update on blur via handleDOMEvents so the decoration matches the current selection at that point, while still skipping DOM mutations during active selection drag. https://claude.ai/code/session_01Qcv5Xm4QcDnzhWdTbfgQh9 * Trim verbose comment in highlightSelectionPlugin https://claude.ai/code/session_01Qcv5Xm4QcDnzhWdTbfgQh9 * Fix selection highlight not showing when editor is blurred The `.selected .selection-highlight` CSS rule required a `.selected` ancestor class that only exists during multiselect, so the highlight was never visible for single-block text selection (e.g. when clicking the toolbar). Remove the `.selected` ancestor requirement so the decoration is visible whenever the editor loses focus. https://claude.ai/code/session_01Qcv5Xm4QcDnzhWdTbfgQh9 --------- Co-authored-by: Claude <noreply@anthropic.com>


+17 -1
2 changed files