fix: fix removing the caret on blur in some situations when using safari, fix #2405
This commit is contained in:
@@ -15,6 +15,10 @@ export const blur: RawCommands['blur'] = () => ({ editor, view }) => {
|
|||||||
requestAnimationFrame(() => {
|
requestAnimationFrame(() => {
|
||||||
if (!editor.isDestroyed) {
|
if (!editor.isDestroyed) {
|
||||||
(view.dom as HTMLElement).blur()
|
(view.dom as HTMLElement).blur()
|
||||||
|
|
||||||
|
// Browsers should remove the caret on blur but safari does not.
|
||||||
|
// See: https://github.com/ueberdosis/tiptap/issues/2405
|
||||||
|
window?.getSelection()?.removeAllRanges()
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user