Open utterances-bot opened 9 months ago
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.
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.
In case I'm using onBlockRendererSlotted
for a block, is it possible to keep rendering using Markdown? How does "template" work?
https://plugins-doc.logseq.com/logseq/provideUI