Skip to content

[macOS] does not activate textfield when it receives accessibility focus #77835

@chunhtai

Description

@chunhtai
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:flutter/rendering.dart';
import 'package:flutter/gestures.dart';
import 'package:url_launcher/url_launcher.dart';
void main() {
  runApp(
    MaterialApp(
      home: Scaffold(
          body: Scaffold(
              body: Center(
                  child: Column(
                    mainAxisAlignment: MainAxisAlignment.center,
                    children: [
                      SelectableText.rich(
                        TextSpan(
                          children: <TextSpan>[
                            TextSpan(text: 'This', style: TextStyle(color: Colors.blue)),
                            TextSpan(text: 'is', style: TextStyle(color: Colors.black)),
                            TextSpan(
                                text: 'test',
                                style: TextStyle(
                                    color: Colors.blue, decoration: TextDecoration.underline),
                                recognizer: TapGestureRecognizer()
                                  ..onTap = () async {
                                    var url = "https://flutter.dev/";
                                    if (await canLaunch(url)) {
                                      await launch(url);
                                    } else {
                                      throw 'Could not launch $url';
                                    }
                                  }),
                          ],
                        ),
                        style: TextStyle(
                            color: Colors.blue, fontWeight: FontWeight.bold, fontSize: 48),
                        textAlign: TextAlign.center,
                      ),
                      Text.rich(
                        TextSpan(
                          children: <TextSpan>[
                            TextSpan(text: 'This', style: TextStyle(color: Colors.blue)),
                            TextSpan(text: 'is', style: TextStyle(color: Colors.black)),
                            TextSpan(
                                text: 'test',
                                style: TextStyle(
                                    color: Colors.blue, decoration: TextDecoration.underline),
                                recognizer: TapGestureRecognizer()
                                  ..onTap = () async {
                                    var url = "https://flutter.dev/";
                                    if (await canLaunch(url)) {
                                      await launch(url);
                                    } else {
                                      throw 'Could not launch $url';
                                    }
                                  }),
                          ],
                        ),
                        style: TextStyle(
                            color: Colors.blue, fontWeight: FontWeight.bold, fontSize: 48),
                        textAlign: TextAlign.center,
                      ),
                      TextField(controller: TextEditingController(text: 'thisistext'),)
                    ],
                  )))),
    ),
  );
}
  1. in macOS, turn on voice over
  2. move the a11y focus to the text field

expect: the textfield should be activate upon focus
actual: nothing happened

Same thing for cupertino text field

Metadata

Metadata

Assignees

Labels

a: accessibilityAccessibility, e.g. VoiceOver or TalkBack. (aka a11y)a: text inputEntering text in a text field or keyboard related problemsf: cupertinoflutter/packages/flutter/cupertino repositoryf: material designflutter/packages/flutter/material repository.frameworkflutter/packages/flutter repository. See also f: labels.platform-macBuilding on or for macOS specifically

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions