searchable_dropdown icon indicating copy to clipboard operation
searchable_dropdown copied to clipboard

Return old value after first select.

Open boungly opened this issue 4 years ago • 13 comments

Current API Version searchable_dropdown: ^1.1.3

Flutter Doctor

[✓] Flutter (Channel stable, v1.12.13+hotfix.9, on Mac OS X 10.15.3 19D76, locale en-KH)
 
[✓] Android toolchain - develop for Android devices (Android SDK version 29.0.2)
[✓] Xcode - develop for iOS and macOS (Xcode 11.4)
[✓] Android Studio (version 3.4)
[✓] VS Code (version 1.44.2)
[✓] Connected device (2 available)

• No issues found!

[Note: The problem is not 100% occurred, but mostly it happens on iOS below 13 and also Android Emulator (API R)]

The problem is

  1. when we first launch the app and selected the value from the dropdown, it returns the correct value back. (exp: Select A and it return A)
  2. But when I try to select a new value [B] from dropdown again, it returns the old value of [A] instead.

It sounds weird, but the problem sometimes disappears when I tried to clean the project a few times.

My BaseDropDownTextField class. BaseDropDownTextField.log

boungly avatar Apr 23 '20 12:04 boungly

UPDATE NOTE This problem seems to happen randomly, I've tried on my iPhoneXS 13.3, the problem also happens.

++ @lcuis @icemanbsi

boungly avatar Apr 24 '20 04:04 boungly

NOTE This is record from my iPhoneXS.

ezgif com-video-to-gif

boungly avatar Apr 24 '20 05:04 boungly

same problum ,is there any way to reset the dropdown,

atta1234 avatar Apr 24 '20 18:04 atta1234

I have same issue on version 1.1.3. This problem solved after rollback to version 1.1.2

lulumeimei avatar Apr 24 '20 19:04 lulumeimei

I found out that the problem happened when my class is using MediaQuery.of(context).size.---. I've fixed the problem by removing that. But I don't know the exact cause of that too.

boungly avatar Apr 26 '20 12:04 boungly

i have same issue already. İs there any body solved that problem? May you help please?

burakhayirli avatar May 29 '20 09:05 burakhayirli

i have same issue already. İs there any body solved that problem? May you help please?

rvats011990 avatar Jun 02 '20 14:06 rvats011990

It seems that @boungly have the right answer but anyone can use it with MediaQuery.... ? I need it for responsive devices using larger text

PhilDevs94 avatar Jun 04 '20 09:06 PhilDevs94

This is the major issue, for me this is the happening in all times and i have tried different 4 devices and its also happening in all devices.

pkmangukiya avatar Jun 04 '20 12:06 pkmangukiya

a lot of hard work I recognized it and fixed it. Value : this is the actual create a issue

SearchableDropdown(
 value: selectedState,      ------- // remove or comment this line
 items: stateDropdownItems,
 hint: Text('Select a State'),
 searchHint: new Text(
     'Search a State' ),
       onChanged: (value) {
             setState(() {
                selectedState = value;
               });
       },
      isExpanded: true,
  )`

 

pkmangukiya avatar Jun 05 '20 09:06 pkmangukiya

a lot of hard work I recognized it and fixed it. Value : this is the actual create a issue

SearchableDropdown(
 value: selectedState,      ------- // remove or comment this line
 items: stateDropdownItems,
 hint: Text('Select a State'),
 searchHint: new Text(
     'Search a State' ),
       onChanged: (value) {
             setState(() {
                selectedState = value;
               });
       },
      isExpanded: true,
  )`

For solve this : https://github.com/icemanbsi/searchable_dropdown/issues/55#issuecomment-639377263

pkmangukiya avatar Jun 05 '20 10:06 pkmangukiya

I have the same issue, but I found anther plugin. It's have a lot of features (such as InputDecoration 😍), and it's look like the TextFormField(). So your UI will be the same.

I recommend you to use this amazing plugin : dropdown_search

Alyahya-A avatar Jun 07 '20 04:06 Alyahya-A

a lot of hard work I recognized it and fixed it. Value : this is the actual create a issue

SearchableDropdown(
 value: selectedState,      ------- // remove or comment this line
 items: stateDropdownItems,
 hint: Text('Select a State'),
 searchHint: new Text(
     'Search a State' ),
       onChanged: (value) {
             setState(() {
                selectedState = value;
               });
       },
      isExpanded: true,
  )`

Well but if you remove this line, how can you initialize value ?

PhilTran1994 avatar Aug 18 '20 08:08 PhilTran1994