AbdulRahmanAlHamali / flutter_typeahead

A TypeAhead widget for Flutter, where you can show suggestions to users as they type
BSD 2-Clause "Simplified" License
831 stars 349 forks source link

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

Open dovydaskaupas opened 5 months ago

dovydaskaupas commented 5 months ago

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 { 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( 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?> _getSuggestions(final String input) async { return ["London", "Paris", "Berlin"] .where((e) => e.contains(input)) .toList(); } } ```

Screenshots or Video

Screenshots / Video demonstration ![magnifier issue demo](https://github.com/AbdulRahmanAlHamali/flutter_typeahead/assets/24279159/9ad08945-3044-415e-b787-15c12b9b3c4a)