fix: set focus on editor conditionally after image upload (#4387)

This commit is contained in:
Aaryan Khandelwal 2024-05-07 15:49:11 +05:30 committed by GitHub
parent f5f683b8b8
commit 967ad77078
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -158,7 +158,7 @@ export async function startImageUpload(
const transaction = view.state.tr.insert(pos - 1, node).setMeta(uploadKey, { remove: { id } });
view.dispatch(transaction);
view.focus();
if (view.hasFocus()) view.focus();
editor.storage.image.uploadInProgress = false;
} catch (error) {
removePlaceholder(editor, view, id);