Fix for unable to open task using keyboard #690
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Issue Description:
When performing keyboard navigation (using the Tab key), the user is unable to open a task item via tab navigation. The focus does not move to the task layout as expected, preventing interaction with it through the keyboard.
RootCause:
The issue occurs because the VerticalStackLayout used in the sample is not focusable by default and does not participate in the keyboard focus chain. In .NET MAUI (and Xamarin.Forms), layout containers such as StackLayout, Grid, or VerticalStackLayout are typically designed for arranging child elements and do not inherently support keyboard focus or input events.
As a result, when navigating via the keyboard, the layout itself never receives focus, so keypress events (like Enter or Space) that would normally trigger an action are ignored.
Description of Change
Introduced an invisible Button layer to ensure consistent accessibility and keyboard navigation across the platform.
Using a button directly with text would either limit the focus area if
HorizontalOptions="Start"is used, and the text would be misaligned ifHorizontalOptions="Fill"is used. The invisible button covers the entire task view without affecting the visual layout, maintaining proper focus and navigation behavior.Added a
Labelto display the task title at the desired position. The label is purely visual and does not handle user interaction, allowing clicks and focus to pass through to the underlying button.Issues Fixed
Fixes #30787
Tested the behaviour in the following platforms
Output Screenshot
BeforeFixAcc.mp4
Recording.2025-10-17.180736.mp4