This seems to be the case. The whole dom tree seems to consist of an “app” node and nothing else. If I add elements via provideUI(), document.getElementById will always return ‘null’ for the ids of these elements. But I can see the element in the debug tools window … Is there a way to access the elements via typescript? Here is some (non working) code as example. Clicking on the link in the popup after /openproject should log a reference to the element, but does not:
import "@logseq/libs";
function main() {
logseq.provideModel({
openCalendar () {
console.log("hi, calendar");
console.log(document.getElementById('tryFindMe'));
console.log(document.getElementById('app')?.childNodes);
},
});
logseq.Editor.registerSlashCommand("openproject", async () => {
logseq.provideUI({
key: 'miktest',
template: `
<button
id="tryFindMe"
data-on-click="openCalendar">
Go Calendar
</button>
`,
})
});
}
logseq.ready(main).catch(console.error);
Regards, Michael