-
-
Notifications
You must be signed in to change notification settings - Fork 384
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
Inline field with list only displays last entry in Live Preview mode #2281
Comments
I reckon, without knowing, this could be a side effect of the bug described in #2216. I've seen it before. The current workaround if I remember it correctly is to split the value setting into two, i.e. |
Sorry for adding to the confusion, but I just saw that this happens only in live preview, and the other one is happening in reading mode. So they might not be connected after all, but then again the changes in the other variant does something strange... |
Looking at the source code, obsidian-dataview/src/ui/render.ts Line 46 in 4829a83
Passing the obsidian-dataview/src/ui/render.ts Line 9 in 4829a83
"list" in obsidian-dataview/src/ui/render.ts Line 45 in 4829a83
Anyway, making these changes, to get the following code, async function renderCompactMarkdownForInlineFieldLivePreview(
app: App,
markdown: string,
container: HTMLElement,
sourcePath: string,
component: Component,
context: ValueRenderContext
) {
const tmpContainer = createSpan();
await MarkdownRenderer.render(app, markdown, tmpContainer, sourcePath, component);
let paragraph = tmpContainer.querySelector(":scope > p");
if (tmpContainer.childNodes.length == 1 && paragraph) {
if (context !== "list") {
container.replaceChildren(...paragraph.childNodes);
} else {
for (let child of paragraph.childNodes) {
container.appendChild(child);
}
}
} else {
container.replaceChildren(...tmpContainer.childNodes);
}
tmpContainer.remove();
} I get the following output in live preview: I'm wary of submitting a PR because I really have no idea how this plugin works; I just followed the trail of the |
Thank you for opening this issue, I encountered the same problem (on Windows). |
What happened?
In Live Preview, when using an inline field of the form
[property:: "value1", "value2"]
, onlyvalue2
(or whatever the last value in the list is) is shown. In the other two modes (Source and Reading) the inline field appears as expected. This occurs in the sandbox vault where Dataview is the only plugin installed.Source mode
Live Preview mode
Reading mode
DQL
JS
Dataview Version
0.5.66
Obsidian Version
Version 1.5.11
OS
MacOS
The text was updated successfully, but these errors were encountered: