Fix cell insertion while editing Markdown cell (#883)

This commit is contained in:
Jonatan Kłosko 2022-01-19 11:34:38 +01:00 committed by GitHub
parent 4ba81cc114
commit 0b1f308b13
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -446,6 +446,11 @@ function handleDocumentMouseDown(hook, event) {
return;
}
// When clicking an insert button, keep focus and insert mode as is
if (event.target.closest(`[data-element="insert-buttons"] button`)) {
return;
}
// Find the focusable element, if one was clicked
const focusableEl = event.target.closest(`[data-focusable-id]`);
const focusableId = focusableEl ? focusableEl.dataset.focusableId : null;