splitwise / TokenAutoComplete

Gmail style MultiAutoCompleteTextView for Android
Apache License 2.0
1.3k stars 384 forks source link

Characters disappear and reappear after same token is deleted and inserted again #391

Open niteshtarani opened 4 years ago

niteshtarani commented 4 years ago

Issue in version 3.0

Steps:

  1. Type some characters (example "abc").
  2. Select token from autocomplete list.
  3. Delete the token with KEYCODE_DEL key on keyboard.
  4. Type same characters ("abc")
  5. After that type any character (example "d") then all the previous characters are deleted from the editable and only the new character ("d") is there.
  6. Type one more character (example "e") then observe all the characters are back in editable and the text is now ("abcde").
mgod commented 4 years ago

This is an unfortunate keyboard interaction. This is probably fixable, but I doubt it will be something I have time for soon. If someone else wants to take a look at this, you'll need to find a keyboard that causes the same kind of input behavior I describe here and take a look at the behavior: https://github.com/splitwise/TokenAutoComplete/issues/381#issuecomment-504126443

niteshtarani commented 4 years ago

Thanks @mgod for responding. I observed issue #308 in version 2 and therefore updated to version 3 ( #308 got fixed in it ) but observed the above mentioned issue. Just wanted to understand if both the issues are connected somehow.

Also wanted to inform that after setting inputType to "textEmailAddress" the height of the view gets fixed and does not expand when adding multiple tokens (height of the view is set to be wrap_content). Need to be able to set this inputType because there are some keyboards (eg. Swiftkey) which enters a space just after typing period (.) and wrong token gets created as space is a split char which email does not have.

Request you to please look into these issues.

mgod commented 4 years ago

The issues are related in that they are both keyboards providing unexpected input, but I don't think anything beyond that.

For your second issue, I'm not sure why you're adding a space as an email separator when ',' and ';' are the generally recognized separators for email addresses, but if you need to use textEmailAddress I would suspect that it's setting the number of lines the view is allowed to have as well, which is what is causing trouble with your height. I would check for that interaction or any other layout related stuff that is setting single line mode or setting the number of lines to 1 in your view.