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

feat: added autocomplete options to url input #128

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

RA341
Copy link
Contributor

@RA341 RA341 commented Sep 8, 2024

Implemented #127, had to make a custom autocomplete because the default one does not accept a controller and defaults to maxwidth.

If no addresses are found:

image

If previous address are present:

image

@@ -266,3 +259,68 @@ class LoginScreen extends HookConsumerWidget {
.trim();
}
}

class UrlFieldInput extends ConsumerWidget {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please extract the widget to another file.

@sevenrats
Copy link
Contributor

Im abroad and can’t test this, but I’m curious if tab-to-complete works with this. Does anybody know?

@RA341
Copy link
Contributor Author

RA341 commented Sep 12, 2024

I tried unsuccessfully to add the shortcut; my best guess is that the textfield is capturing the tab event preventing the shortcut to execute.

@RA341
Copy link
Contributor Author

RA341 commented Sep 12, 2024

i am not sure how to disable that behaviour

@sevenrats
Copy link
Contributor

Can we extend TextField?

@RA341
Copy link
Contributor Author

RA341 commented Sep 12, 2024

Probably, but I don't think textfield itself is the issue its something related to focus and focus node

@RA341
Copy link
Contributor Author

RA341 commented Sep 12, 2024

tab.mp4

The flickering is me pressing tab

@sevenrats
Copy link
Contributor

flutter/flutter#75032

@sevenrats
Copy link
Contributor

Just glancing but maybe DefaultTextEditingAction

@RA341
Copy link
Contributor Author

RA341 commented Sep 12, 2024

I tried it still the same behavior,

the autocomplete is made up of 2 parts a textfield and a listview that displays the options, now I am not sure if focus is passed to the listview or remains with textfield.

which I believe is the issue, If the focus remains with textfield (which I suspect it is) when we press tab the textfield attempts to go to the next field which resets autocomplete causing the behavior in the video.

but I could be wrong and its not any of the above

@RA341
Copy link
Contributor Author

RA341 commented Sep 12, 2024

yeah i changed the shortcut to ctrl_space it still wont work I am pretty sure it's a focus issue

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

Successfully merging this pull request may close these issues.

3 participants