maheshj01 / searchfield

A highly customizable simple and easy to use flutter Widget to add a searchfield to your Flutter Application.This Widget allows you to search and select from list of suggestions.
MIT License
84 stars 64 forks source link

An Overlay issue's occurs on Searchfield When a screen has Mutliple textfield . #148

Closed ShafiMunshi closed 4 months ago

ShafiMunshi commented 5 months ago

Describe the bug My screen has multiple textfield and searchfield. After tapping on searchfield it show's all the suggestion , I choose one of them. then I input some data on other textfield. but when I try to change something in the previous searchfield again, it show's me this bug:

The OverlayEntry was: OverlayEntry#a6732(opaque: false; maintainState: false) The Overlay the OverlayEntry was trying to insert to was: OverlayState#37442(entries: [OverlayEntry#751ff(opaque: true; maintainState: false) entries: [OverlayEntry#751ff(opaque: true; maintainState: false), OverlayEntry#22623(opaque: false; maintainState: true)] Consider calling remove on the OverlayEntry before inserting it to a different Overlay, or switching to the OverlayPortal API to avoid manual OverlayEntry management

To Reproduce Steps to reproduce the behavior:

  1. Make multiple textfield and searchfield
  2. Click on searchfield and choose some suggestion or input some data 3 Click on a regular textfield , and input something,
  3. then again , click on the previous searchfield again.
  4. See an overlay error

[ ] By clicking this checkbox, I confirm I am using the latest version of the package found on pub.dev/searchfield

Expected behavior I don't want to expect any overlay issues

Screenshots Error: Screenshot from 2024-06-16 11-31-15

Code sample

Show code sample ```dart // just a simple field to produce this bug class TestScreen extends StatelessWidget { const TestScreen({super.key}); @override Widget build(BuildContext context) { final controller = TextEditingController(); return Scaffold( appBar: AppBar(), body: Column( mainAxisAlignment: MainAxisAlignment.spaceEvenly, children: [ searchField('hinText', Icons.pedal_bike, ['shafi', 'rahat'], (val) {}, controller), TextField( ), ], ), ); } } ```

Additional context Add any other context about the problem here.

maheshj01 commented 5 months ago

Glad someone found this issue, initially reported https://github.com/maheshmnj/searchfield/issues/143

Caused by https://github.com/maheshmnj/searchfield/pull/142/files

ShafiMunshi commented 5 months ago

issues fixed.

maheshj01 commented 5 months ago

@ShafiMunshi Can you explain is this not an issue with searchfield? Lets leave this issue open until we are sure that this has been taken care of.

ShafiMunshi commented 4 months ago

Oh, this issue has fixed by updated the latest version.,

maheshj01 commented 4 months ago

Thanks for the confirmation!