Open johnsonmh opened 4 years ago
@johnsonmh I am not able to reproduce this. When I scroll all the way down, I can move a11y focus to the text field and when I double-tap it gets input focus and I can enter text.
When you say that you "cannot focus on the text field" - what do you mean by this? You can't give it a11y focus? Or you can't get it into a mode where it has input focus?
Also, what iOS device where you using?
I'm using the iPhone XS, not the XS Max, but rather the smaller size (which could account for the difference).
And by "cannot focus on the text field", I mean when I navigate to the text field with voiceover, it says "Text Field, double tap to enter", but when I double tap, it does not bring the keyboard up.
Can you try it again on your device but make the second container ~1200
pixels tall instead of 400
? I think it's important that the header fully collapse before the bug reproduces.
Thanks for the information. I can reproduce this now.
I looked at this briefly. When you double-tap while the textfield has a11y focus, that double tap is not forwarded to the flutter framework (window.onSemanticsAction
does not fire), which is odd (This is true whether or not the textfield is scrolled up). Somehow, double-tapping on a textfield is completely handled in the engine's a11y bridge and it seems that the engine can only properly bring up the keyboard if the actual TextField is in the center of the semantics node.
This problem can actually easily be reproduced in much simpler settings without scrolling:
import 'package:flutter/material.dart';
void main() {
runApp(Demo());
}
class Demo extends StatelessWidget {
@override
Widget build(BuildContext context) {
return MaterialApp(
home: Scaffold(
body: Semantics(
container: true,
child: Container(
color: Colors.green,
height: 500,
child: Align(
alignment: Alignment.bottomCenter,
child: TextField(),
),
),
),
),
);
}
}
The problem occurs whenever the textfield is not in the center of the a11y-focused area.
I quick work-around is to wrap the textfield in a Semantics container to make sure that the semantics node only has the size of the actual textfield:
Container(
height: 400,
child: Center(
child: Semantics(
container: true,
child: TextField(),
),
),
),
@johnsonmh Is this enough to unblock the customer? Or is fixing this still customer critical?
/cc @xster FYI since the actual problem seems to be in the iOS accessibility bridge.
There's still an issue here: If you have an accessibility node with a text field inside you cannot input-focus it if the textfield is not in the center of the node, see https://github.com/flutter/flutter/issues/52863#issuecomment-604159185.
I can focus on texiifeld after scrolll
Adding passed first triage
based on https://github.com/flutter/flutter/issues/52863#issuecomment-613726989
Internal: b/151285964
When a text field is in the body of a sliver list, and you scroll the sliver list under a sliver app bar, the text field is no longer editable through iOS VoiceOver.
Seems similar to https://github.com/flutter/flutter/issues/45394.
Steps to Reproduce
Using the following example app:
SliverAppBar
is collapsed.Also notice that if the app is not scrolled, the
TextField
is editable even with VoiceOver enabled.Expected results: Text field can be focused on and text can be entered.
Actual results: Text field can not be focused on or edited.
Flutter doctor output
``` Doctor summary (to see all details, run flutter doctor -v): [✓] Flutter (Channel fix-defaultTextStyleAboveMaterialApp, v1.15.12-pre.4, on Mac OS X 10.14.6 18G3020, locale en-US) [!] Android toolchain - develop for Android devices (Android SDK version 29.0.2) ! Some Android licenses not accepted. To resolve this, run: flutter doctor --android-licenses [!] Xcode - develop for iOS and macOS (Xcode 11.3) ! CocoaPods 1.7.5 out of date (1.8.0 is recommended). CocoaPods is used to retrieve the iOS and macOS platform side's plugin code that responds to your plugin usage on the Dart side. Without CocoaPods, plugins will not work on iOS or macOS. For more info, see https://flutter.dev/platform-plugins To upgrade: sudo gem install cocoapods [✓] Chrome - develop for the web [✓] Android Studio (version 3.6) [✓] Android Studio (version 3.5) [✓] Connected device (5 available) ! Doctor found issues in 2 categories. ``` ``` ```