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

Make SuggestionBox can be on top of TextField. #9

Closed
yohom opened this issue Oct 16, 2018 · 11 comments
Closed

Make SuggestionBox can be on top of TextField. #9

yohom opened this issue Oct 16, 2018 · 11 comments

Comments

@yohom
Copy link

yohom commented Oct 16, 2018

Is there any way to put the SuggestionBox above TextField? Because now my situation is that the input method will block the SuggestionBox, so I want to make the SuggestionBox above the TextField.

@AbdulRahmanAlHamali
Copy link
Owner

Hey,

So you want to show the suggestions to the top instead of the bottom, depending on how much visible space there is? or depending on what exactly?

@yohom
Copy link
Author

yohom commented Oct 16, 2018

Yeah, except the SuggestionBox's location and growth direction(up instead of down) are different, other features should be the same as the current ones. I feel like the whole point of this function is to fix the bottom of the ListView and grow it up. Do you have any ideas?

@AbdulRahmanAlHamali
Copy link
Owner

Thank you for the suggestion! This is a nice feature to have.

This might take me some time to implement as I am a bit busy these few days. If you're in a hurry, you can implement it and submit a pull request :) Otherwise, I will try to implement it as soon as possible.

@yohom
Copy link
Author

yohom commented Oct 16, 2018

Thank you. I will try to implement it.

yohom added a commit to yohom/flutter_typeahead that referenced this issue Oct 16, 2018
yohom added a commit to yohom/flutter_typeahead that referenced this issue Oct 16, 2018
@Rassell
Copy link

Rassell commented Jan 7, 2019

Updated pull request here:

#20

@AbdulRahmanAlHamali
Copy link
Owner

@KaYBlitZ @sjmcdowall, @Rassell has been generous enough to upload a pull request addressing this issue, but the pull request has a lot of noise (unrelated changes), which are making it a bit hard to extract the core changes that the pull request actually does.

Does any of you have the time to review the pull request and extract its core changes into another pull request?

@KaYBlitZ
Copy link
Contributor

I tested @Rassell 's version and found a few weird behaviors. Using

noResize: false, direction: AxisDirection.up,

the most relevant search is at the top of the suggestions box. Not sure if this is the intended behavior or if the list should be reversed, ie: most relevant object at bottom of box and least relevant going up. I believe the list should be reversed since the direction is up.

I also tried

noResize: true, direction: AxisDirection.up,

but the list goes down instead of up.

Also if the keyboard is covering the TextBox, the list does not go up and instead is not shown at all.

I think most of these breaking changes came from when I implemented the auto-resize and scrolling fixes.
To be sure, I tested @yohom 's original fork and found that it grows up, but does not scroll. This comes from the original problem that I fixed where the entire list is being shown so scrolling isn't possible.

It's a good start, but there needs to be more fixes so it meshes well with the breaking changes that I have made.

@KaYBlitZ
Copy link
Contributor

@Rassell @yohom If you guys have time, can you test my fork for the up direction functionaliy? I modified the code from your PRs to work with the auto-resize feature I added before. This way we do not have to add a noResize attribute and it will just work. In pubspec.yaml use:

flutter_typeahead:
    git: 'https://github.com/KaYBlitZ/flutter_typeahead.git'

@KaYBlitZ
Copy link
Contributor

I committed to master. Someone just has to push to the pub @sjmcdowall @AbdulRahmanAlHamali . I also added my email in pubspec.yaml if you want to give me access.

Let us know if anyone finds an issue with the direction property.

@sjmcdowall
Copy link
Collaborator

sjmcdowall commented Jan 23, 2019 via email

@sjmcdowall
Copy link
Collaborator

sjmcdowall commented Jan 24, 2019 via email

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