dotnet / dotnet/maui

[Android] IsReadOnly=true EditText controls are not focusable

Open
#6,250 4 comments 1 reaction 0 assignees View on GitHub
area-controls-entry csi-new platform/android platform/ios platform/macos s/triaged s/verified t/a11y t/bug testing-manual
Dominant language
C#
Stars
23.3k
Forks
2k
Avg merge
1d 14h
Merged PRs (30d)
296

Description

### Description

When Entry, Editor, and SearchBar controls are set with IsReadOnly=true, they are not only ReadOnly but also not focusable on Android. We should disassociate the two so that the focus behavior is not affected, and we can correct related keyboard accessibility anomalies.

The following code must be removed:
https://github.com/dotnet/maui/blob/523cb3eca9bf0e3c7b63c5748f36b5e570c1c829/src/Core/src/Platform/Android/EditTextExtensions.cs#L150-L151
https://github.com/dotnet/maui/blob/523cb3eca9bf0e3c7b63c5748f36b5e570c1c829/src/Core/src/Platform/Android/EditTextExtensions.cs#L170-L171
https://github.com/dotnet/maui/blob/523cb3eca9bf0e3c7b63c5748f36b5e570c1c829/src/Core/src/Platform/Android/SearchViewExtensions.cs#L96-L97

and a solution must replace it. One potential approach may be to nest the control within a container which is focusable.

### Steps to Reproduce

1. Run .NET MAUI control gallery
2. Navigate to EntryPage, EditorPage, SearchBarPage
3. Use keyboard to tab through controls. Notice the keyboard cannot reach the IsReadOnly=true control

### Version with bug

Release Candidate 1 (current)

### Last version that worked well

Unknown/Other

### Affected platforms

Android

### Affected platform versions

/

### Did you find any workaround?

_No response_

### Relevant log output

_No response_

Contributor guide

Open the contributing guide

Research direction

Review the referenced sections of src/Core/src/Platform/Android/EditTextExtensions.cs and SearchViewExtensions.cs, then reproduce the issue in the .NET MAUI control gallery through EntryPage, EditorPage, and SearchBarPage. Verify that IsReadOnly controls remain reachable by keyboard focus and that the related keyboard accessibility behavior is corrected.

Written by the indexing model from the issue text.

Assessment

Tech stack
android, csharp
Domain
accessibility, mobile
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.