-
Notifications
You must be signed in to change notification settings - Fork 1
Open
Description
Search first
- I searched and no similar issues were found
What Happened?
Using logseq.Editor.updateBlock plugin API does not update the content displayed. But it does update the database and the changes will be applied after refreshing Logseq.
Reproduce the Bug
-
Create an example plugin:
<!doctype html> <html lang="en"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0"> <meta http-equiv="X-UA-Compatible" content="ie=edge"> <title>Logseq bug</title> </head> <body> <div id="app"></div> <script src="https://cdn.jsdelivr.net/npm/@logseq/libs"></script> <script src="./index.js"></script> </body> </html>
function main () { logseq.App.registerCommandShortcut( { binding: 'mod+shift+9', mode: 'editing' }, async () => { const block = await logseq.Editor.getCurrentBlock() console.log(block) if (block === null) return await logseq.Editor.updateBlock(block.uuid, "Updated Content") }, { label: 'Update Content', key: 'trigger' }, ) } // bootstrap logseq.ready(main).catch(console.error)
{ "name": "logseq-bug", "version": "1.0.0", "description": "", "main": "index.html", "logseq": { "id": "logseq-bug" }, "license": "MIT" } - Edit some block
- Press ctrl+shift+9
- The block content displayed is not changed. But it will be updated to "Updated Content" after reloading the app.
Expected Behavior
The block content is updated to "Updated Content"
Files
Screencast_20260308_103537.mp4
Browser, Desktop or Mobile Platform Information
Linux, Desktop App, 2.0.1
Additional Context
Related issue report from logseq-live-math: AllanChain/logseq-live-math#45.
Are you willing to submit a PR? If you know how to fix the bug.
- I'm willing to submit a PR (Thank you!)
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels