{
if (!measuringOngoingGuard) return;
- // Wait for the changed content which fired the `updated()` Vue event to be put into the DOM
+ // Wait for the changed content which fired the `afterUpdate()` Svelte event to be put into the DOM
await tick();
// Wait until all fonts have been loaded and rendered so measurements of content involving text are accurate
@@ -216,15 +216,15 @@
await tick();
// Measure the width of the floating menu content element, if it's currently visible
- // The result will be `undefined` if the menu is invisible, perhaps because an ancestor component is hidden with a falsy `v-if` condition
+ // The result will be `undefined` if the menu is invisible, perhaps because an ancestor component is hidden with a falsy Svelte template if condition
const naturalWidth: number | undefined = floatingMenuContent?.div().clientWidth;
- // Turn off measuring mode for the component, which triggers another call to the `updated()` Vue event, so we can turn off the protection after that has happened
+ // Turn off measuring mode for the component, which triggers another call to the `afterUpdate()` Svelte event, so we can turn off the protection after that has happened
measuringOngoing = false;
await tick();
measuringOngoingGuard = false;
- // Emit the measured natural width to the parent
+ // Notify the parent about the measured natural width
if (naturalWidth !== undefined && naturalWidth >= 0) {
dispatch("naturalWidth", naturalWidth);
}
diff --git a/frontend-svelte/src/components/panels/NodeGraph.svelte b/frontend-svelte/src/components/panels/NodeGraph.svelte
index e3a7f72b..3139a883 100644
--- a/frontend-svelte/src/components/panels/NodeGraph.svelte
+++ b/frontend-svelte/src/components/panels/NodeGraph.svelte
@@ -244,8 +244,7 @@
y: Math.round(((e.clientY - graphBounds.y) / transform.scale - transform.y) / GRID_SIZE),
};
- // Find actual relevant child and focus it
- // TODO: Svelte: check if this works and if `setTimeout` can be removed
+ // Find actual relevant child and focus it (setTimeout is required to actually focus the input element)
setTimeout(() => nodeSearchInput.focus(), 0);
document.addEventListener("keydown", keydown);
diff --git a/frontend-svelte/src/components/widgets/WidgetRow.svelte b/frontend-svelte/src/components/widgets/WidgetRow.svelte
index a6bec62f..3b2f0e3d 100644
--- a/frontend-svelte/src/components/widgets/WidgetRow.svelte
+++ b/frontend-svelte/src/components/widgets/WidgetRow.svelte
@@ -80,7 +80,7 @@
}
-
+
diff --git a/frontend-svelte/src/components/widgets/inputs/ColorInput.svelte b/frontend-svelte/src/components/widgets/inputs/ColorInput.svelte
index 601b578c..94a89de7 100644
--- a/frontend-svelte/src/components/widgets/inputs/ColorInput.svelte
+++ b/frontend-svelte/src/components/widgets/inputs/ColorInput.svelte
@@ -35,7 +35,16 @@
{chip}
{/if}
- (open = detail)} color={value} on:color={({ detail }) => dispatch("value", detail)} allowNone={true} />
+ (open = detail)}
+ color={value}
+ on:color={({ detail }) => {
+ value = detail;
+ dispatch("value", detail);
+ }}
+ allowNone={true}
+ />