Skip to content

Commit

Permalink
Fix: Resolve copy button visibility issue in Textbox component (#9859)
Browse files Browse the repository at this point in the history
* Fix: Resolve copy button visibility issue in Textbox component

* restore tabs

* add changeset

* changes

* format

---------

Co-authored-by: Ali Abid <[email protected]>
Co-authored-by: gradio-pr-bot <[email protected]>
Co-authored-by: aliabid94 <[email protected]>
Co-authored-by: Abubakar Abid <[email protected]>
  • Loading branch information
5 people authored Oct 31, 2024
1 parent d9a0f17 commit c1cb5be
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 18 deletions.
6 changes: 6 additions & 0 deletions .changeset/tidy-bikes-allow.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
"@gradio/textbox": patch
"gradio": patch
---

fix:Fix: Resolve copy button visibility issue in Textbox component
36 changes: 18 additions & 18 deletions js/textbox/shared/Textbox.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -198,6 +198,23 @@

<!-- svelte-ignore a11y-autofocus -->
<label class:container class:show_textbox_border>
{#if show_label && show_copy_button}
{#if copied}
<button
in:fade={{ duration: 300 }}
class="copy-button"
aria-label="Copied"
aria-roledescription="Text copied"><Check /></button
>
{:else}
<button
on:click={handle_copy}
class="copy-button"
aria-label="Copy"
aria-roledescription="Copy text"><Copy /></button
>
{/if}
{/if}
<BlockTitle {root} {show_label} {info}>{label}</BlockTitle>

<div class="input-container">
Expand Down Expand Up @@ -256,23 +273,6 @@
/>
{/if}
{:else}
{#if show_label && show_copy_button}
{#if copied}
<button
in:fade={{ duration: 300 }}
class="copy-button"
aria-label="Copied"
aria-roledescription="Text copied"><Check /></button
>
{:else}
<button
on:click={handle_copy}
class="copy-button"
aria-label="Copy"
aria-roledescription="Copy text"><Copy /></button
>
{/if}
{/if}
<textarea
data-testid="textbox"
use:text_area_resize={value}
Expand Down Expand Up @@ -392,7 +392,7 @@
right: var(--block-label-margin);
align-items: center;
box-shadow: var(--shadow-drop);
border: 1px solid var(--color-border-primary);
border: 1px solid var(--border-color-primary);
border-top: none;
border-right: none;
border-radius: var(--block-label-right-radius);
Expand Down

0 comments on commit c1cb5be

Please sign in to comment.