maui icon indicating copy to clipboard operation
maui copied to clipboard

[MAC-CATALYST] Presses methods not triggered for input keys in Entry

Open Lakshminatarajan opened this issue 2 years ago • 5 comments

Description

PressesBegan and PressesEnded override methods not triggered when typing text in the Entry. Only the input keys such as Alphabets, numbers and delete keys are not detected.

This scenario occurs only on mac-catalyst and iOS working fine.

Steps to Reproduce

  1. Run the attached sample in mac.
  2. Click the entry and type.

Expected behavior: PressesBegan and PressesEnded methods should be triggered when typing. Actual behavior: PressesBegan and PressesEnded methods not triggered.

Link to public reproduction project repository

Sample

Version with bug

6.0.486 (current)

Last version that worked well

Unknown/Other

Affected platforms

macOS

Affected platform versions

MacCatalyst-15.4.442

Did you find any workaround?

No

Relevant log output

NA

Lakshminatarajan avatar Sep 01 '22 07:09 Lakshminatarajan

Hi @Lakshminatarajan. We have added the "s/needs-repro" label to this issue, which indicates that we require steps and sample code to reproduce the issue before we can take further action. Please try to create a minimal sample project/solution or code samples which reproduce the issue, ideally as a GitHub repo that we can clone. See more details about creating repros here: https://github.com/dotnet/maui/blob/main/.github/repro.md

This issue will be closed automatically in 7 days if we do not hear back from you by then - please feel free to re-open it if you come back to this issue after that time.

ghost avatar Sep 01 '22 18:09 ghost

Can you attach a simplified repo or a public one please?

PureWeen avatar Sep 01 '22 18:09 PureWeen

Hi @PureWeen ,

Please find the replication sample below, DemoIssue_b37b5479.zip

Lakshminatarajan avatar Sep 05 '22 09:09 Lakshminatarajan

We've moved this issue to the Backlog milestone. This means that it is not going to be worked on for the coming release. We will reassess the backlog following the current release and consider this item at that time. To learn more about our issue management process and to have better expectation regarding different types of issues you can read our Triage Process.

ghost avatar Sep 05 '22 14:09 ghost

@jfversluis are there any expectations when this could be resolved/investigated? In our project, we're facing the same problem for pincode entry when an external keyboard (bluetooth) is attached.

rkops-bd avatar Mar 09 '23 20:03 rkops-bd

Hi @rkops-bd and @Lakshminatarajan thanks for your report, I had some time to look at the issue and this seems to be an issue with Apple's MacCatalyst and not with MAUI or the iOS dotnet sdk.

I have tried this in .net iOS and got the same issues, then I went to try on objective c MacCatalyst app and I also get the same. So this seems a problem with Catalyst. You should open a bug with Apple at https://developer.apple.com/bug-reporting/

here's the .net iOS code I used:

 public partial class ViewController : UIViewController
 {
        public override void ViewDidLoad ()
        {
            View.Add(new CustomTextField());
            base.ViewDidLoad ();
        }
    }

    public class CustomTextField : UITextField
    {
        public CustomTextField()
        {
            Text = "hello";
            BackgroundColor = UIColor.Cyan;
            Frame = new CoreGraphics.CGRect(20, 20, 320, 100);
        }

        public override void PressesBegan(NSSet<UIPress> presses, UIPressesEvent evt)
        {
            System.Diagnostics.Debug.WriteLine($"NativeCustomEntry: PressesBegan {presses.AnyObject.Key.KeyCode.ToString()}");
            base.PressesBegan(presses, evt);
        }
}

here the objective C code I used

@implementation ViewController

- (void)viewDidLoad {
    CGRect customFrame = CGRectMake(50, 50, 400, 50);
    CustomTextField *textField = [[CustomTextField alloc] initWithFrame:customFrame];
    textField.text = @"hello";
    [self.view addSubview:textField];
    [super viewDidLoad];
}

@end

@implementation CustomTextField

- (id)initWithFrame:(CGRect)frame
{
    self = [super initWithFrame:frame];
    if (self) {
        self.delegate = self;
    }
    self.backgroundColor = UIColor.systemPinkColor;
return self;
}

- (void)pressesBegan:(NSSet<UIPress *> *)presses withEvent:(UIPressesEvent *)event
{
    NSLog(@"NativeCustomEntry: PressesBegan %ld",  presses.anyObject.key.keyCode);
}

@end

Thanks best regards Rui

rmarinho avatar Mar 20 '23 12:03 rmarinho