maui
maui copied to clipboard
[MAC-CATALYST] Presses methods not triggered for input keys in Entry
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
- Run the attached sample in mac.
- 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
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
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.
Can you attach a simplified repo or a public one please?
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.
@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.
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