Skip to content

Commit

Permalink
fix: Speed up drawing of Tasks blocks after 2.0.0 release (#1801)
Browse files Browse the repository at this point in the history
* Revert "fix: render in canvas (#1733)"

This reverts commit d7593a2.

Fixes #1800, but reopens #1732

* docs: Document limitations with Canvas cards.
  • Loading branch information
claremacrae authored Mar 26, 2023
1 parent 9120cc2 commit 0ef61c2
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 12 deletions.
16 changes: 16 additions & 0 deletions docs/getting-started/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,22 @@ Completing a task by clicking its checkbox from a `tasks` query block _will_ wor
Warning
{: .label .label-yellow}

Tasks cannot read tasks that are in **Obsidian Canvas cards**.

---

Warning
{: .label .label-yellow}

Tasks does not display Tasks query blocks that are in **Obsidian Canvas cards**.

We are tracking this in [issue #1732](https://github.com/obsidian-tasks-group/obsidian-tasks/issues/1732).

---

Warning
{: .label .label-yellow}

Tasks cannot read tasks that are **inside code blocks**, such as the ones used by the **Admonitions plugin**. Use Obsidian's built-in callouts instead.

---
Expand Down
21 changes: 9 additions & 12 deletions src/QueryRenderer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,18 +25,15 @@ export class QueryRenderer {
public addQueryRenderChild = this._addQueryRenderChild.bind(this);

private async _addQueryRenderChild(source: string, element: HTMLElement, context: MarkdownPostProcessorContext) {
const child = new QueryRenderChild({
app: this.app,
events: this.events,
container: element,
source,
filePath: context.sourcePath,
});

context.addChild(child);

child.load();
child.onload();
context.addChild(
new QueryRenderChild({
app: this.app,
events: this.events,
container: element,
source,
filePath: context.sourcePath,
}),
);
}
}

Expand Down

0 comments on commit 0ef61c2

Please sign in to comment.