mirror of
https://github.com/gradio-app/gradio.git
synced 2025-01-18 10:44:33 +08:00
Fixed upload dialog being showed after pressing "x" button (#2577)
* Fixed upload dialog being showed on clear #2476 * Changelog update * Formatting fix * click replaced with disable_click Co-authored-by: Abubakar Abid <abubakar@huggingface.co> Co-authored-by: Dawood Khan <dawoodkhan82@gmail.com>
This commit is contained in:
parent
a6e72f7814
commit
ad62a8a8a3
@ -1137,6 +1137,7 @@ We've introduced a lot of new components in `3.0`, including `Model3D`, `Dataset
|
||||
* Mobile responsive guides by [@aliabd](https://github.com/aliabd) in [PR 1293](https://github.com/gradio-app/gradio/pull/1293)
|
||||
* Update readme by [@abidlabs](https://github.com/abidlabs) in [PR 1292](https://github.com/gradio-app/gradio/pull/1292)
|
||||
* gif by [@abidlabs](https://github.com/abidlabs) in [PR 1296](https://github.com/gradio-app/gradio/pull/1296)
|
||||
* Fixed issue #2476 with upload dialog [@mezotaken](https://github.com/mezotaken) in [PR 2577](https://github.com/gradio-app/gradio/pull/2577)
|
||||
|
||||
## Contributors Shoutout:
|
||||
|
||||
|
@ -8,5 +8,11 @@
|
||||
|
||||
<div class="z-50 top-2 right-2 justify-end flex gap-1 absolute">
|
||||
<IconButton Icon={Undo} on:click={() => dispatch("undo")} />
|
||||
<IconButton Icon={Clear} on:click={() => dispatch("clear")} />
|
||||
<IconButton
|
||||
Icon={Clear}
|
||||
on:click={(event) => {
|
||||
dispatch("clear");
|
||||
event.stopPropagation();
|
||||
}}
|
||||
/>
|
||||
</div>
|
||||
|
@ -510,7 +510,7 @@
|
||||
flex={false}
|
||||
center={false}
|
||||
boundedheight={false}
|
||||
click={false}
|
||||
disable_click={true}
|
||||
on:load={(e) => blob_to_string(data_uri_to_blob(e.detail.data))}
|
||||
bind:dragging
|
||||
>
|
||||
|
@ -21,5 +21,11 @@
|
||||
<IconButton Icon={Edit} on:click={() => dispatch("edit")} />
|
||||
{/if}
|
||||
|
||||
<IconButton Icon={Clear} on:click={() => dispatch("clear")} />
|
||||
<IconButton
|
||||
Icon={Clear}
|
||||
on:click={(event) => {
|
||||
dispatch("clear");
|
||||
event.stopPropagation();
|
||||
}}
|
||||
/>
|
||||
</div>
|
||||
|
@ -6,7 +6,6 @@
|
||||
export let include_file_metadata = true;
|
||||
export let dragging = false;
|
||||
export let boundedheight: boolean = true;
|
||||
export let click: boolean = true;
|
||||
export let center: boolean = true;
|
||||
export let flex: boolean = true;
|
||||
export let file_count: string = "single";
|
||||
@ -21,8 +20,8 @@
|
||||
};
|
||||
|
||||
const openFileUpload = () => {
|
||||
if (!click) return;
|
||||
if (disable_click) return;
|
||||
hidden_upload.value = "";
|
||||
hidden_upload.click();
|
||||
};
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user