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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix Checkbox select dispatch #5340

Merged
merged 2 commits into from Aug 25, 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.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
6 changes: 6 additions & 0 deletions .changeset/stale-lizards-cut.md
@@ -0,0 +1,6 @@
---
"@gradio/checkbox": patch
"gradio": patch
---

fix:Fix Checkbox select dispatch
5 changes: 3 additions & 2 deletions js/checkbox/interactive/InteractiveCheckbox.svelte
Expand Up @@ -4,6 +4,7 @@
import { Block, Info } from "@gradio/atoms";
import { StatusTracker } from "@gradio/statustracker";
import type { LoadingStatus } from "@gradio/statustracker";
import type { SelectData } from "@gradio/utils";
import { _ } from "svelte-i18n";

export let elem_id = "";
Expand All @@ -19,7 +20,7 @@
export let loading_status: LoadingStatus;
export let gradio: Gradio<{
change: never;
select: never;
select: SelectData;
input: never;
}>;
</script>
Expand All @@ -36,6 +37,6 @@
bind:value_is_output
on:change={() => gradio.dispatch("change")}
on:input={() => gradio.dispatch("input")}
on:select={() => gradio.dispatch("select")}
on:select={(e) => gradio.dispatch("select", e.detail)}
/>
</Block>
5 changes: 3 additions & 2 deletions js/checkbox/static/StaticCheckbox.svelte
Expand Up @@ -4,6 +4,7 @@
import { Block, Info } from "@gradio/atoms";
import { StatusTracker } from "@gradio/statustracker";
import type { LoadingStatus } from "@gradio/statustracker";
import type { SelectData } from "@gradio/utils";

export let elem_id = "";
export let elem_classes: string[] = [];
Expand All @@ -18,7 +19,7 @@
export let loading_status: LoadingStatus;
export let gradio: Gradio<{
change: never;
select: never;
select: SelectData;
input: never;
}>;
</script>
Expand All @@ -35,7 +36,7 @@
bind:value_is_output
on:change={() => gradio.dispatch("change")}
on:input={() => gradio.dispatch("input")}
on:select={() => gradio.dispatch("select")}
on:select={(e) => gradio.dispatch("select", e.detail)}
disabled
/>
</Block>