-
Notifications
You must be signed in to change notification settings - Fork 6k
Mark the Flutter Views as focusable by setting a tabindex value. #50876
Changes from 1 commit
deaf50b
6f69db8
87ddd10
db97ed8
e40ddd6
f3ba20d
78731aa
6905458
314e4b6
1e576f1
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
When a given flutter view is focused its tabindex will be -1 When a given flutter view is not focused its tabindex will be 0
- Loading branch information
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -79,7 +79,7 @@ class EnginePlatformDispatcher extends ui.PlatformDispatcher { | |
| _addLocaleChangedListener(); | ||
| registerHotRestartListener(dispose); | ||
| AppLifecycleState.instance.addListener(_setAppLifecycleState); | ||
| ViewFocusBinding.instance.addListener(invokeOnViewFocusChange); | ||
| _viewFocusBinding.init(); | ||
| domDocument.body?.append(accessibilityPlaceholder); | ||
| _onViewDisposedListener = viewManager.onViewDisposed.listen((_) { | ||
| // Send a metrics changed event to the framework when a view is disposed. | ||
|
|
@@ -123,7 +123,7 @@ class EnginePlatformDispatcher extends ui.PlatformDispatcher { | |
| _removeLocaleChangedListener(); | ||
| HighContrastSupport.instance.removeListener(_updateHighContrast); | ||
| AppLifecycleState.instance.removeListener(_setAppLifecycleState); | ||
| ViewFocusBinding.instance.removeListener(invokeOnViewFocusChange); | ||
| _viewFocusBinding.dispose(); | ||
| accessibilityPlaceholder.remove(); | ||
| _onViewDisposedListener.cancel(); | ||
| viewManager.dispose(); | ||
|
|
@@ -228,6 +228,11 @@ class EnginePlatformDispatcher extends ui.PlatformDispatcher { | |
| } | ||
| } | ||
|
|
||
| late final ViewFocusBinding _viewFocusBinding = ViewFocusBinding( | ||
tugorez marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| viewManager: viewManager, | ||
| onViewFocusChange: invokeOnViewFocusChange, | ||
|
||
| ); | ||
|
|
||
| @override | ||
| ui.ViewFocusChangeCallback? get onViewFocusChange => _onViewFocusChange; | ||
| ui.ViewFocusChangeCallback? _onViewFocusChange; | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.