1
0
mirror of https://github.com/bitwarden/mobile synced 2026-01-03 09:03:35 +00:00
Files
mobile/src/iOS.Autofill/PasswordGeneratorViewController.cs
Matt Portune b163a0fe77 fix for stuck extension sheets when dismissed by swipe (#1117)
* fix for stuck extension sheets when dismissed by swipe

* simplify dismiss action assignments
2020-10-15 14:34:31 -04:00

36 lines
1.1 KiB
C#

using System;
using UIKit;
namespace Bit.iOS.Autofill
{
public partial class PasswordGeneratorViewController : Core.Controllers.PasswordGeneratorViewController
{
public PasswordGeneratorViewController(IntPtr handle)
: base(handle)
{
DismissModalAction = Cancel;
}
public LoginAddViewController Parent { get; set; }
public override UINavigationItem BaseNavItem => NavItem;
public override UIBarButtonItem BaseCancelButton => CancelBarButton;
public override UIBarButtonItem BaseSelectBarButton => SelectBarButton;
public override UILabel BasePasswordLabel => PasswordLabel;
partial void SelectBarButton_Activated(UIBarButtonItem sender)
{
DismissViewController(true, () => Parent.PasswordCell.TextField.Text = PasswordLabel.Text);
}
partial void CancelBarButton_Activated(UIBarButtonItem sender)
{
Cancel();
}
private void Cancel()
{
DismissViewController(true, null);
}
}
}