Skip to content

Commit

Permalink
Trying to replicate issue of some shortcuts triggering
Browse files Browse the repository at this point in the history
  • Loading branch information
benjypng committed Feb 4, 2022
1 parent 802e7dc commit f193e76
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 5 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "darwis-mathlive-plugin",
"version": "1.0.2",
"version": "1.0.3",
"description": "",
"main": "dist/index.html",
"targets": {
Expand Down
19 changes: 15 additions & 4 deletions src/mathliveCustom.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,17 +35,28 @@ export const renderMathLive = (

top?.document
.getElementById('formula')
.addEventListener('input', (ev) => {
//@ts-expect-error
logseq.Editor.upsertBlockProperty(uuid, 'output', ev.target.value);
.addEventListener('input', async (ev) => {
await logseq.Editor.exitEditingMode();
await logseq.Editor.upsertBlockProperty(
uuid,
'output',
//@ts-expect-error
ev.target.value
);
});

top?.document
.getElementById('formula')
.addEventListener('change', async () => {
await logseq.Editor.restoreEditingCursor();
});
}, 500);
}

async render() {
const output = await logseq.Editor.getBlockProperty(uuid, 'output');

this.innerHTML = `<math-field id="formula" virtual-keyboard-mode=manual style="
this.innerHTML = `<math-field tabindex="-1" id="formula" virtual-keyboard-mode=manual style="
font-size: 22px;
border-radius: 8px;
padding: 0 0 20px 20px;
Expand Down

0 comments on commit f193e76

Please sign in to comment.