mirror of
https://github.com/gradio-app/gradio.git
synced 2025-01-18 10:44:33 +08:00
3290 fix dropdown infinite loop (#3295)
* Fix infinite loop * lint * CHANGELOG
This commit is contained in:
parent
372a3cca2f
commit
7b2f9cf2ea
@ -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.
|
||||
|
@ -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>
|
||||
|
Loading…
Reference in New Issue
Block a user