Skip to content
This repository was archived by the owner on Feb 25, 2025. It is now read-only.

Commit ab25a1e

Browse files
authored
Prepend the accessibility placeholder (#51050)
Prepends the accesibility placeholder. Previously it was being appended (last child) to the body. Relevant Issues are: * Design doc: https://flutter.dev/go/focus-management * Focus in web multiview: flutter/flutter#137443 * Platform dispatcher changes: #49841 [C++, Objective-C, Java style guides]: https://github.com/flutter/engine/blob/main/CONTRIBUTING.md#style
1 parent 9e8ccaa commit ab25a1e

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

lib/web_ui/lib/src/engine/platform_dispatcher.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ class EnginePlatformDispatcher extends ui.PlatformDispatcher {
8080
registerHotRestartListener(dispose);
8181
AppLifecycleState.instance.addListener(_setAppLifecycleState);
8282
ViewFocusBinding.instance.addListener(invokeOnViewFocusChange);
83-
domDocument.body?.append(accessibilityPlaceholder);
83+
domDocument.body?.prepend(accessibilityPlaceholder);
8484
_onViewDisposedListener = viewManager.onViewDisposed.listen((_) {
8585
// Send a metrics changed event to the framework when a view is disposed.
8686
// View creation/resize is handled by the `_didResize` handler in the

lib/web_ui/test/engine/platform_dispatcher/platform_dispatcher_test.dart

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -409,8 +409,9 @@ void testMain() {
409409
});
410410
});
411411

412-
test('appends an accesibility placeholder', () {
412+
test('adds the accesibility placeholder', () {
413413
expect(dispatcher.accessibilityPlaceholder.isConnected, isTrue);
414+
expect(domDocument.body!.children.first, dispatcher.accessibilityPlaceholder);
414415
});
415416

416417
test('removes the accesibility placeholder', () {

0 commit comments

Comments
 (0)