Skip to content

Commit

Permalink
fix(frontend): add support for step id change for forloops and branch… (
Browse files Browse the repository at this point in the history
#4395)

* fix(frontend): add support for step id change for forloops and branchone + add initial value for DebounchedInput

* fix(frontend): fix initial value of DebouncedInput
  • Loading branch information
fatonramadani committed Sep 16, 2024
1 parent d57b139 commit 97839a3
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<script lang="ts">
import { onMount } from 'svelte'
import { twMerge } from 'tailwind-merge'
export let placeholder: string = 'Search...'
Expand All @@ -11,6 +12,7 @@
export { parentClass as class }
let timer: NodeJS.Timeout
let inputElement: HTMLInputElement | null = null
function debounce(event: KeyboardEvent): void {
clearTimeout(timer)
Expand All @@ -20,9 +22,16 @@
value = target.value
}, debounceDelay)
}
onMount(() => {
if (inputElement && value !== undefined) {
inputElement.value = value
}
})
</script>

<input
bind:this={inputElement}
{placeholder}
on:pointerdown|stopPropagation
on:keyup={debounce}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -348,6 +348,14 @@
}
})
)
} else if (mod?.value?.type === 'forloopflow') {
if (mod.value.iterator.type === 'javascript') {
mod.value.iterator.expr = replaceId(mod.value.iterator.expr, id, newId)
}
} else if (mod?.value?.type === 'branchone') {
mod.value.branches.forEach((branch) => {
branch.expr = replaceId(branch.expr, id, newId)
})
}
})
}
Expand Down

0 comments on commit 97839a3

Please sign in to comment.