We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent fd6ea7b commit 8739ad8Copy full SHA for 8739ad8
src/main.ts
@@ -373,14 +373,18 @@ ${editor.getDoc().getSelection()}
373
if (ev.defaultPrevented || ev.detail > 1 || ev.shiftKey)
374
return;
375
try {
376
- const pos = editor.posAtDOM(admonitionElement);
377
- editor.focus();
378
- editor.dispatch({
379
- selection: {
380
- head: pos,
381
- anchor: pos
382
- }
383
- });
+ setTimeout(() => {
+ try {
+ const pos = editor.posAtDOM(admonitionElement);
+ editor.focus();
+ editor.dispatch({
+ selection: {
+ head: pos,
+ anchor: pos
384
+ }
385
+ });
386
+ } catch (e) {}
387
+ }, 10);
388
} catch (e) {}
389
});
390
}
0 commit comments