Skip to content

[Feature Request] API to explicitly set accessibility focus #94523

@luomo-pro

Description

@luomo-pro

First of all, thank the flutter team for their contribution to accessibility.
I am a blind person and a developer,Because I don't speak English, I use a translator, and the description may not be very accurate. If you have any questions, please ask.
There are many accessibility standards around the world, and one of them is a very important standard, which is to maintain a stable focus.
Currently, flutter's management of accessibility focus is not perfect, and there are many problems.
For example, when you jump to a new page return, the Android side should set the accessibility focus to the previous position, but currently, it is set to the first control on the page.
The accessibility focus may be lost when the list item is rebuilt, and so on.
These problems can be solved using APIs that set accessibility focus.
Whether it is Android, iOS, web, or Windows, there are corresponding native APIs that can set the accessibility focus.

iOS:
UIAccessibilityPostNotification(UIAccessibilityLayoutChangedNotification, view);
Android:
view.sendAccessibilityEvent(AccessibilityEvent.TYPE_VIEW_FOCUSED);
web:
view.focus();
Windows:
NotifyWinEvent(EVENT_OBJECT_FOCUS, hwnd, OBJID_CLIENT, childId);

Now only the input focus can be set in flutter, but the accessibility focus cannot be set.
This issue was raised and discussed two years ago at the earliest, but it has not yet been resolved.
And I read the previous issue:
#91290
#59594
#77200

The result of these discussions is that although Android provides an API for setting accessibility focus, it is not intended to allow developers to actively set accessibility focus, and it may not take effect in the future.
But I want to say that in addition to Android, iOS, Windows, and the Web also have APIs for setting accessibility focus. Are they all redundant?
the people of Android said that it might not be allowed to take effect in the future, but it has been around for a long time, and there are many great accessibility applications, using this feature to meet the accessibility standards.
At least until now, APIs for setting accessibility focus on all platforms can work well.
Even if Android is no longer supported in the future, there are still iOS, Windows, web, so many platforms that support it.
That being the case, why doesn't flutter add an API for setting accessible focus now?

Some people say that if the developer actively sets the accessibility focus, it will make the application difficult to understand.
I want to say, is there any developer who will take the initiative to set the accessibility focus indiscriminately?
And flutter can now set the input focus, why has no one said to remove this API?
I believe that so many platforms have this API natively, and the purpose is definitely to make the software more accessible. Otherwise, why would they add this API?
Developers actively set accessibility focus to bring users a better experience.

Maybe because there is no blind person in the flutter team, so don't know the importance of this API to the disabled.
As a blind user and developer, I very much begged to increase the accessibility focus API!
It is very important to blind people all over the world!
And only in this way, a lot of software can be truly accessible, in line with global accessibility standards!
thank you very much!
@chunhtai

Metadata

Metadata

Assignees

Labels

P0Critical issues such as a build break or regressiona: accessibilityAccessibility, e.g. VoiceOver or TalkBack. (aka a11y)c: new featureNothing broken; request for a new capabilityc: proposalA detailed proposal for a change to Fluttercustomer: chalk (g3)customer: googleVarious Google teamsframeworkflutter/packages/flutter repository. See also f: labels.r: fixedIssue is closed as already fixed in a newer version

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions