[go: up one dir, main page]

Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

🧩 logseq.provideUI #14

Open
utterances-bot opened this issue Sep 19, 2023 · 5 comments
Open

🧩 logseq.provideUI #14

utterances-bot opened this issue Sep 19, 2023 · 5 comments

Comments

@utterances-bot
Copy link

https://plugins-doc.logseq.com/logseq/provideUI

Copy link

Is there a way to know whether the provided slot was invalid?
I have a plugin that uses onMacroRendererSlotted but the UI needs to be updated every few seconds and I use a JavaScript timeout for that.
However, when the user edits the block etc. the slot can become invalid.
Logseq detects this and prints a message like can not resolve selector target #slot__whppb9x3.
It would be great if provideUI could throw an exception instead of just printing to the console, so I can stop trying to update the invalid slot in this case.

Copy link

Here are supported methods defined in https://github.com/logseq/logseq/blob/master/libs/src/helpers.ts#L422-L451

    'click',
    'focus',
    'focusin',
    'focusout',
    'blur',
    'dblclick',
    'keyup',
    'keypress',
    'keydown',
    'change',
    'input',
    'contextmenu',

Notice that use data-on-focusout instead of data-on-focus-out

Works fine except on-blur, which does not bubble.

Copy link

In case I'm using onBlockRendererSlotted for a block, is it possible to keep rendering using Markdown? How does "template" work?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants
@daviddavo @5hir0kur0 @Sansui233 @utterances-bot and others