Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug] Magnifier doesn't show the text on iOS #591

Open
dovydaskaupas opened this issue Jun 26, 2024 · 0 comments
Open

[Bug] Magnifier doesn't show the text on iOS #591

dovydaskaupas opened this issue Jun 26, 2024 · 0 comments
Labels
bug Something isn't working

Comments

@dovydaskaupas
Copy link

dovydaskaupas commented Jun 26, 2024

Steps to reproduce

  1. Long-press on text in the TypeAheadField to show the Magnifier widget.

Expected results

Magnifier displays the focused text.

Actual results

After the update from 4.8.0 to 5.2.0, the magnifier widget doesn't display the focused text on iOS.

Package Version

5.2.0

Platform

iOS

Code sample

Code sample
class _MyHomePageState extends State<MyHomePage> {
  final TextEditingController _editingController = TextEditingController();

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        backgroundColor: Theme.of(context).colorScheme.error,
        title: Text(widget.title),
      ),
      body: Center(
        child: Padding(
          padding: const EdgeInsets.symmetric(horizontal: 16),
          child: Column(
            mainAxisAlignment: MainAxisAlignment.center,
            children: [
              TextField(
                controller: TextEditingController(),
                autofocus: true,
                decoration: const InputDecoration(
                  border: OutlineInputBorder(),
                  labelText: 'TextField',
                ),
              ),
              const SizedBox(height: 16),
              TypeAheadField<String>(
                hideOnEmpty: true,
                controller: _editingController,
                suggestionsCallback: _getSuggestions,
                builder: (context, controller, focusNode) {
                  return TextField(
                    controller: controller,
                    focusNode: focusNode,
                    autofocus: true,
                    decoration: const InputDecoration(
                      border: OutlineInputBorder(),
                      labelText: 'TypeAheadField',
                    ),
                  );
                },
                itemBuilder: (context, text) {
                  return ListTile(
                    title: Text(text),
                    subtitle: Text(text),
                  );
                },
                onSelected: (text) => print(text),
              ),
            ],
          ),
        ),
      ),
    );
  }

  FutureOr<List<String>?> _getSuggestions(final String input) async {
    return ["London", "Paris", "Berlin"]
        .where((e) => e.contains(input))
        .toList();
  }
}

Screenshots or Video

Screenshots / Video demonstration

magnifier issue demo

@dovydaskaupas dovydaskaupas added the bug Something isn't working label Jun 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant