Merge pull request #5455 from Sec-ant/fix/check-visibility

fix: skip resize handler updates when DOM node is not visible
This commit is contained in:
Peter Kogo
2025-09-02 11:52:31 +02:00
committed by GitHub
6 changed files with 75 additions and 40 deletions

View File

@@ -155,6 +155,8 @@
// console.log(edges.map((edge) => ({ id: edge.id, selected: edge.selected })));
edges.forEach((edge) => console.log({ id: edge.id, selected: edge.selected }));
});
let hidden = $state(false);
</script>
<!-- oninit={() => console.log('on init')}
@@ -197,6 +199,7 @@
}} -->
<SvelteFlow
style="display:{hidden ? 'none' : 'block'}"
bind:nodes
bind:edges
{nodeTypes}
@@ -247,7 +250,20 @@
<InitTracker />
</SvelteFlow>
<button
class="hide"
onclick={() => {
hidden = !hidden;
}}>Hide/Unhide</button
>
<style>
.hide {
position: absolute;
top: 80px;
right: 15px;
}
:root {
/* --background-color: #ffffdd; */
--background-pattern-color: #5050ff;