-
-
Notifications
You must be signed in to change notification settings - Fork 222
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
Can't initiate render in plugin: Tabs #2941
Comments
Hi, thanks for using Tasks. There are a couple of things I don't understand about this request...
|
Hi, thanks for your reply.
text = "```tasks\nnot done\n```", MarkdownRender.render(app, text, el, ...) The query is successful, but the element generated by the query is not rendered. After I tried to add this.onload() to the QueryRenderChild constructor, the result generated by the query was rendered. So the issue was raised in search of a solution.
|
There is content in your screenshot in the reproduction that is not provided as text for me to copy, so for reasons explained in the following post, I am unable to investigate: https://publish.obsidian.md/tasks/Support+and+Help/Report+a+Bug And since this is a bug involving another plugin, please create a minimal vault that reproduces the problem, and attach it here. Many thanks. |
Very grateful for your assistance! I create a minimal vault that reproduces the problem. |
Brilliant - that was a great set of examples, making the behaviour really clear. I was able to see the problem, and work out which code location you were talking about changing.... This patch does make the Tasks query in the Tabs code block render the tasks, and all the Tasks facilities work fine. Index: src/Renderer/QueryRenderer.ts
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/src/Renderer/QueryRenderer.ts b/src/Renderer/QueryRenderer.ts
--- a/src/Renderer/QueryRenderer.ts (revision a80decedfb21c14f8fef0826ee7b0d6f55705f78)
+++ b/src/Renderer/QueryRenderer.ts (date 1720420427772)
@@ -38,16 +38,16 @@
public addQueryRenderChild = this._addQueryRenderChild.bind(this);
private async _addQueryRenderChild(source: string, element: HTMLElement, context: MarkdownPostProcessorContext) {
- context.addChild(
- new QueryRenderChild({
- app: this.app,
- plugin: this.plugin,
- events: this.events,
- container: element,
- source,
- filePath: context.sourcePath,
- }),
- );
+ const queryRenderChild = new QueryRenderChild({
+ app: this.app,
+ plugin: this.plugin,
+ events: this.events,
+ container: element,
+ source,
+ filePath: context.sourcePath,
+ });
+ context.addChild(queryRenderChild);
+ queryRenderChild.load();
}
} |
Awesome - thanks very much indeed @xhuajin for finding the issue and the fix! |
Also thank you for the fix. Have a good day! |
This will be included in the next Tasks release. |
The fix for this is now released, in Tasks 7.6.1. |
Get it. Thanks for your efforts. |
Please check that this issue hasn't been reported before.
Expected Behavior
Expected render tasks view in plugin tabs.
Current behaviour
Query results component doesn't automaticly render.
Steps to reproduce
Which Operating Systems are you using?
Obsidian Version
1.6.2
Tasks Plugin Version
7.6.0
Checks
Possible solution
After testing, I found that the issue is that the query results of the tasks plugin are not rendering. Adding a
this.onload();
at the end of the constructor of theQueryRenderChild
class inQueryRenderer.ts
allows it to render normally. (Dataview also does this. See dataview/plugin-api.ts).https://github.com/blacksmithgu/obsidian-dataview/blob/15b8d527e3d5822c5ef9bfd23f528a64769d545b/src/api/plugin-api.ts#L400
Could you please add an active render step, or is there anything I can do to help?
The text was updated successfully, but these errors were encountered: