Skip to content

Commit

Permalink
Modify CopyToClipboard to fix IOS issue.
Browse files Browse the repository at this point in the history
  • Loading branch information
onerdy committed Mar 3, 2024
1 parent eeff2f8 commit 7ef2f18
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions Components/CopyToClipboard.razor
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@

<MudSnackbarProvider />

<MudIconButton OnClick="OnClick" Icon="@Icons.Material.Filled.ContentCopy" Size="Size.Small" />
@* <MudIconButton OnClick="OnClick" Icon="@Icons.Material.Filled.ContentCopy" Size="Size.Small" /> *@
<button onclick="@OnClick" style="background-color:lightgray; padding:5px;border-radius: 4px;">Copy</button>

@code {

Expand All @@ -15,8 +16,8 @@
private async Task OnClick()
{
Snackbar.Configuration.SnackbarVariant = Variant.Text;
Snackbar.Configuration.VisibleStateDuration = 1000;
Snackbar.Configuration.HideTransitionDuration = 1000;
Snackbar.Configuration.VisibleStateDuration = 1500;
Snackbar.Configuration.HideTransitionDuration = 0;
Snackbar.Configuration.ShowTransitionDuration = 0;
Snackbar.Configuration.MaximumOpacity = 20;
Snackbar.Configuration.ShowCloseIcon = false;
Expand All @@ -27,9 +28,9 @@
Snackbar.Add("Password copied!", Severity.Success);
}

catch
catch(Exception e)
{
Snackbar.Add("Failed to copy password!", Severity.Error);
Snackbar.Add(e.Message, Severity.Error);
}


Expand Down

0 comments on commit 7ef2f18

Please sign in to comment.