Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Prevent label change event from triggering itself #4371

Merged
merged 9 commits into from
Jun 2, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ No changes to highlight.

## Bug Fixes:

- Fix bug where Label change event was triggering itself by [@freddyaboulton](https://github.com/freddyaboulton) in [PR 4371](https://github.com/gradio-app/gradio/pull/4371)
- Make `Blocks.load` behave like other event listeners (allows chaining `then` off of it) [@anentropic](https://github.com/anentropic/) in [PR 4304](https://github.com/gradio-app/gradio/pull/4304)
- Respect `interactive=True` in output components of a `gr.Interface` by [@abidlabs](https://github.com/abidlabs) in [PR 4356](https://github.com/gradio-app/gradio/pull/4356).
- Remove unused frontend code by [@akx](https://github.com/akx) in [PR 4275](https://github.com/gradio-app/gradio/pull/4275)
Expand Down
7 changes: 4 additions & 3 deletions js/app/src/components/Label/Label.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@
export let visible: boolean = true;
export let color: undefined | string = undefined;
export let value: {
label: string;
label?: string;
confidences?: Array<{ label: string; confidence: number }>;
};
} = {};
export let label: string = "Label";
export let style: Styles = {};

Expand All @@ -24,7 +24,8 @@

const dispatch = createEventDispatcher<{ change: undefined }>();

$: value, dispatch("change");
$: ({ confidences, label: _label } = value);
$: _label, confidences, dispatch("change");
</script>

<Block
Expand Down
2 changes: 1 addition & 1 deletion js/label/src/Label.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import { createEventDispatcher } from "svelte";

export let value: {
label: string;
label?: string;
confidences?: Array<{ label: string; confidence: number }>;
};

Expand Down