mirror of
https://github.com/gradio-app/gradio.git
synced 2024-11-27 01:40:20 +08:00
Fix .clear()
events for audio and image (#5587)
* clear * add changeset --------- Co-authored-by: gradio-pr-bot <gradio-pr-bot@users.noreply.github.com>
This commit is contained in:
parent
0be1e51f4f
commit
e0d61b8baa
7
.changeset/better-dingos-find.md
Normal file
7
.changeset/better-dingos-find.md
Normal file
@ -0,0 +1,7 @@
|
||||
---
|
||||
"@gradio/audio": patch
|
||||
"@gradio/image": patch
|
||||
"gradio": patch
|
||||
---
|
||||
|
||||
fix:Fix `.clear()` events for audio and image
|
@ -44,6 +44,7 @@
|
||||
start_recording: never;
|
||||
stop_recording: never;
|
||||
upload: never;
|
||||
clear: never;
|
||||
}>;
|
||||
|
||||
let old_value: null | FileData | string = null;
|
||||
@ -97,6 +98,7 @@
|
||||
on:start_recording={() => gradio.dispatch("start_recording")}
|
||||
on:stop_recording={() => gradio.dispatch("stop_recording")}
|
||||
on:upload={() => gradio.dispatch("upload")}
|
||||
on:clear={() => gradio.dispatch("clear")}
|
||||
on:error={({ detail }) => {
|
||||
loading_status = loading_status || {};
|
||||
loading_status.status = "error";
|
||||
|
@ -113,6 +113,7 @@
|
||||
}
|
||||
|
||||
async function handle_sketch_clear(): Promise<void> {
|
||||
dispatch("clear");
|
||||
sketch.clear();
|
||||
await tick();
|
||||
value = null;
|
||||
|
Loading…
Reference in New Issue
Block a user