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

Option to keep suggestion box "as is" until loading is done? #44

Closed
magnus-lpa opened this issue Feb 15, 2019 · 11 comments
Closed

Option to keep suggestion box "as is" until loading is done? #44

magnus-lpa opened this issue Feb 15, 2019 · 11 comments

Comments

@magnus-lpa
Copy link

Maybe I'm doing something wrong, but when testing with suggestions that take only 100 ms to load, the box disappears and reappears, even with

animationStart: 1,
animationDuration: Duration(microseconds: 0),

IMHO it would look much nicer if the current suggestions would stay until new ones are loaded. Would it make sense to have an option (or set a duration) for not updating the suggestion box at all until new suggestions are loaded?

@sjmcdowall
Copy link
Collaborator

sjmcdowall commented Feb 15, 2019 via email

@AbdulRahmanAlHamali
Copy link
Owner

That is interesting indeed. So the old suggestions will keep showing until new suggestions have been loaded. I think that might work, but will require some significant rewrite on some parts of the plugin. Also, we will have to make sure that this option plays well with the other options that we currently have, like the animation, etc.
It's definitely worth exploring though.

For now, if you want, we have an option hideOnLoading which hides the suggestions box when the suggestions are loading. Would that make it look better for you?

@wsakka
Copy link

wsakka commented Mar 4, 2019

I agree it would be better to maintain the old result set as currently it's quite distracting to the end user (esp if it takes a second or more to return results). At the very least, it should be an option. We may need to uninstall until this behaviour is modified.

@sjmcdowall
Copy link
Collaborator

@wsakka -- I have never seen this behavior and we use plugin all over the place. Can you create (or someone) some reproducible little project that shows this?

As a work around why can't you await the loading yourself (I assume you're passing in a Future?) and once complete call setState() to rebuild .. or maybe make the callback async and await in there? Can't tell exactly what you are doing .. what is the code?

@wsakka
Copy link

wsakka commented Mar 5, 2019

@sjmcdowall I know you didn't bring it up but my apologies first of all for the tone of my last sentence, upon re-reading it sounded angry in tone when that wasn't my intention. It was just that the project manager did not like the behaviour so we may have to find another solution.

That being said, I captured a video of what I was referring to. Basically, if the user is typing any address (in this case 58 simeon lane), they should have the option of selecting the address that is already there.

https://streamable.com/spsp6

@sjmcdowall
Copy link
Collaborator

sjmcdowall commented Mar 5, 2019 via email

@wsakka
Copy link

wsakka commented Mar 5, 2019

I was using the Network Link Conditioner to simulate a slow connection (sorry meant to mention that). I'm away from my computer so I should have some sample code tonight.

Edit: However, the video does seem to support the initial issue raised by @magnus-lpa .

@KaYBlitZ
Copy link
Contributor

KaYBlitZ commented Mar 5, 2019

Hi guys. Made some changes in my fork that I believe will address this issue. Haven't found any bugs when I checked but let me know how it works. #66 . My fork to test: https://github.com/KaYBlitZ/flutter_typeahead.git . The changes will make this behavior the default. I believe maintain the old results before the updates is the intended way for this widget to function instead of constantly resizing with the circular progress indicator.

@KaYBlitZ
Copy link
Contributor

KaYBlitZ commented Mar 5, 2019

Make sure to switch to the develop branch when testing....

@sjmcdowall
Copy link
Collaborator

sjmcdowall commented Mar 6, 2019 via email

@sjmcdowall
Copy link
Collaborator

Fixed in 1.2.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants