3290 fix dropdown infinite loop (#3295)

* Fix infinite loop

* lint

* CHANGELOG
This commit is contained in:
Freddy Boulton 2023-02-23 10:55:43 -05:00 committed by GitHub
parent 372a3cca2f
commit 7b2f9cf2ea
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 1 deletions

View File

@ -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.

View File

@ -14,7 +14,9 @@
change: string | Array<string>;
}>();
$: 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);
}
</script>