Skip to content

Commit

Permalink
Fix Checkbox select dispatch (#5340)
Browse files Browse the repository at this point in the history
* Fix bug

* add changeset

---------

Co-authored-by: gradio-pr-bot <gradio-pr-bot@users.noreply.github.com>
  • Loading branch information
freddyaboulton and gradio-pr-bot committed Aug 25, 2023
1 parent 67a8e97 commit df090e8
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 4 deletions.
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>

0 comments on commit df090e8

Please sign in to comment.