-
-
Notifications
You must be signed in to change notification settings - Fork 147
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
Disappearing chip after typing only 1 character. #34
Comments
Hi @Albert221, Unless I'm misunderstanding the issue. |
Let me explain the issue in more detail. When I type I hope you understand my issue now. |
I now get the point. That would be highly undesirable behavior. I've however tried to reproduce this issue to no avail. Could you kindly share versions of the package or Flutter channel you're on? |
I created a simple repository with some code to reproduce the issue: https://github.com/Albert221/flutter_chips_input_issue_34 Just clone the repo, run
You should see I've also created a Flutter Driver test, but it's not working as expected, but you can run it with
Here's my
|
@danvick were you able to correctly reproduce the issue? |
Not even with your dev channel. |
I have the same problem on my android emulator. I you type 'a' and select 'Alpha', next if you directly type 'b', the first chips disappears and there is 'ab' written on the inputchips. Seems the text is not cleared after the first chip selection. |
Thanks for shedding more light on this @bartekpacia. I've finally been able to reproduce. So just to be clear this issue occurs only:
Right? I'll try to investigate the cause of the bug and see. I suspect it may be a Flutter issue related to #1 |
@danvick Thanks for investigating, but happens to me also on a physical device |
It happens on physical devices too and using both physical and onscreen keyboard |
Noted @Albert221 @KarnerTh. I think I've found the culprit. Let me now work on a fix. |
Not quite yet. I'll reopen this. |
I have the same problem too on an Android device, but not on an Android emulator |
Having the very same issue, both on Android Emulator and devices. |
This issues only happens on the very first chip. I hope it throws some light on the subject |
Which (data) are you referring to? profile? Didn't work here. I might be
missing something.
Em qui., 9 de jul. de 2020 às 21:40, VitorSoaresDev1 <
[email protected]> escreveu:
… It happened to me aswell. I've changed the onTap method on
suggestionBuilder to
"() => _chipKey.currentState.selectSuggestion(data),".
Please test and see if it's a valid workaround.
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#34 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AELGGH2OEJJDEPIZS5H4YOTR2ZPPZANCNFSM4MECQMXA>
.
|
So I've been looking into this as well after experiencing this issue myself. As far as I can tell, selecting a suggestion after typing one character causes the One workaround that has worked for me is to simply recreate the text input connection on every text input state change. This can be found at https://github.com/Mosc/flutter_chips_input/commit/321544efea98a056ab94e066453ad4d2b841b1b6. I'm hesitant to create a pull request because this doesn't feel like a proper fix, yet it might help out others who experience the same issue. Please don't count on my fork being available forever, but try it out by updating your flutter_chips_input:
git:
url: https://github.com/Mosc/flutter_chips_input
ref: 321544efea98a056ab94e066453ad4d2b841b1b6 |
The fix released in v1.9.4 unfortunately breaks flutter web usage. Using v.1.9.4 in web, one can no longer put in more than one character (tested on Chrome/MacOS). |
That happened to me too! You can type only one character in web in all versions: 1.9.4, 1.9.0, 1.7.0 |
This changes set a proper initial value for the internal text state. Fix danvick#34
This changes set a proper initial value for the internal text state. Fix danvick#34
Add kIsWeb from package danvick#34
For those still using this library, I have given up on waiting for danvick and created a new fork. I've integrated all of the open PRs and fixed a bug or two. Still working on another bug related to backspace on macOS. |
Hey! My problem is as following and I'm pretty sure it's a problem with the library because my code is the code from example but only attached to my state.
Steps to reproduce
Type only one character into the input and select something from suggestions, then start typing again. The just added chip disappears and it becomes an ordinary text.
When you put only two characters it doesn't happen. When you select a suggestion without typing anything, it doesn't happen too.
Demo
The text was updated successfully, but these errors were encountered: