-
Notifications
You must be signed in to change notification settings - Fork 421
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[BUG] Touchbehavior Keyboard Access Click not working on Android #2443
Comments
I see you mention .NET MAUI on .NET 8, are you able to test with .NET 9? And the latest Toolkit release? Does that change anything? Just to make sure we're looking at the latest and greatest? It does seem that you already dug in quite a bit. Maybe you're able to propose a change for this through a PR? |
I just retested it with .NET9 and latest Maui release 9.0.100 and CommunityToolkit 11.0.0. Currently I can only test Android, but now the Touchbehavior is not working at all anymore. Additional testing: 9.1.1 still works, 10.0.0 and 11.0.0 do not work |
Be sure to assign the Additional information available on StackOverflow: https://stackoverflow.com/a/79099574/5953643 |
Yep, that helps. The standard functionality with that manual Binding works. The original issue of the Android Keyboard usage persists. even with .NET 9 and newest Toolkit version |
I would like to create a PR for a change, but I have no rights to create a branch or something. My proposal for a fix would be to separate the event of the KeyBoard action by reacting to the KeyPress event. It results so that the click event is not triggered by the spacebar anymore and only raises the KeyPress event:
|
Thanks @plewm. You must first fork the repository before you can submit a pull request. Here's a walkthrough: https://opensource.com/article/19/7/create-pull-request-github |
you can look at: do I have to add you guys or someone specific as reviewer somehow? |
Is there an existing issue for this?
Did you read the "Reporting a bug" section on Contributing file?
Current Behavior
When you use an App on Android via Keyboard access/navigation and you try to hit a button via space bar for example, the animation is executed, but the click event is not raised or executed
Expected Behavior
You would expect the Click to be executed normally, like it does on iOS
Steps To Reproduce
In the Example App:
Link to public reproduction project repository
https://github.com/plewm/TouchbehaviorExample
Environment
Anything else?
From my debugging I found the issue to be the accessibilityManager and bool IsAccessibilityMode. it seems the accessibilityManager is null and accessibility mode is just false if the App is only used with keyboard. It will only be set if TalkBack is activated on the device. The Keyboard actions than also work, when TalkBack is activated as well. But the App should be usable with only keyboard without TalkBack as well. The Problem is, that the bool IsAccessibilityMode is checked in the OnClick method and is not reaching the HandleTouchEnded if AccessibilityMode is false.:
`void UpdateClickHandler()
{
if (view is null || !view.IsAlive())
{
return;
}
void OnClick(object? sender, EventArgs args)
{
if (!IsEnabled)
{
return;
}
Furthermore that implementation feels not as Android intended cause the documentation on Android side says not to do different stuff based on the AccessibilityManger because it results in inconsistent behavior.
https://developer.android.com/reference/android/view/accessibility/AccessibilityManager
The text was updated successfully, but these errors were encountered: