diff --git a/CHANGELOG.md b/CHANGELOG.md index ab039bcf86..58e095b1c0 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -14,6 +14,7 @@ - Fix bug where matplotlib images where always too small on the front end by [@freddyaboulton](https://github.com/freddyaboulton) in [PR 3274](https://github.com/gradio-app/gradio/pull/3274) - Prevent Sketch from crashing when a default image is provided by [@pngwn](https://github.com/pngwn) in [PR 3277](https://github.com/gradio-app/gradio/pull/3277) - Respect the `shape` argument on the front end when creating Image Sketches by [@pngwn](https://github.com/pngwn) in [PR 3277](https://github.com/gradio-app/gradio/pull/3277) +- Fix infinite loop caused by setting `Dropdown's` value to be `[]` and adding a change event on the dropdown by [@freddyaboulton](https://github.com/freddyaboulton) in [PR 3295](https://github.com/gradio-app/gradio/pull/3295) ## Documentation Changes: No changes to highlight. diff --git a/ui/packages/form/src/Dropdown.svelte b/ui/packages/form/src/Dropdown.svelte index 8f5f596c8d..7a93ee34fd 100644 --- a/ui/packages/form/src/Dropdown.svelte +++ b/ui/packages/form/src/Dropdown.svelte @@ -14,7 +14,9 @@ change: string | Array; }>(); - $: if (!multiselect) { + // The initial value of value is [] so that can + // cause infinite loops in the non-multiselect case + $: if (!multiselect && !Array.isArray(value)) { dispatch("change", value); }