android-fhir icon indicating copy to clipboard operation
android-fhir copied to clipboard

Make the autocomplete widget more usable

Open KhumboLihonga opened this issue 2 years ago • 7 comments

Is your feature request related to a problem? Please describe. I'm always frustrated when using the auto-complete widget to select a single option. To begin with, two letters need to be typed before any options are made visible. In addition, the widget unnecessarily expands to a multi-line widget.

Describe the solution you'd like

  1. When typing, I think it would be better if the suggestions would show after typing the first letter as opposed to the first two letters.
  2. If repeats is set to false i.e. only one option is allowed, after the option is selected, the widget should not expand to a multi line widget. It should remain on a single line.
  3. If repeats is set to false i.e. only one option is allowed, after the option is selected, the blinking cursor should disappear. If a user wants to replace the existing selection, they can tap the 'x' on the chip to remove it. Once it is removed, the blinking cursor can re-appear to signal they can add a selection once again.

Describe alternatives you've considered Currently using drop-downs instead.

Additional context N/A

Would you like to work on the issue? The autocomplete issue was originally worked on here, if the author could take a second look at it, that would be appreciated.

KhumboLihonga avatar Sep 08 '22 14:09 KhumboLihonga

@f-odhiambo Kindly take a look

Gental-Giant avatar Sep 09 '22 08:09 Gental-Giant

This will need to be triaged

f-odhiambo avatar Sep 09 '22 09:09 f-odhiambo

i think these make a lot of sense

jingtang10 avatar Sep 14 '22 16:09 jingtang10

@KhumboLihonga Great suggestions, I agree with all of these recommendations.

Another challenge with the auto complete component is that you cannot see a list of options (if it were a dropdown you could see the list of all the options similarly to how https://github.com/google/android-fhir/issues/764 is described )

@KhumboLihonga What's the use case you're using auto complete for? Is seeing a list of options for auto complete important or not? Do you think you'd continue to use the auto complete component if the Filter/Search in a dropdown feature https://github.com/google/android-fhir/issues/764 was built.

Thanks for your input and feedback.

shelaghm avatar Sep 20 '22 22:09 shelaghm

@shelaghm We have multiple places where we will use this. One of them is selecting a single practitioner out of a list of practitioners. These practitioners could be over a hundred names for some facilities so scrolling through that list can be a pain. Being able to quickly filter the names based on the initial input would really speed up the process.

With regards to https://github.com/google/android-fhir/issues/764, I think if this was implemented, we wouldn't need the autocomplete. Our current use cases deal with selecting a single item from the list so I think this would be great actually.

KhumboLihonga avatar Sep 22 '22 06:09 KhumboLihonga

Thanks @KhumboLihonga Understanding your use case is very helpful. Sounds like https://github.com/google/android-fhir/issues/764 would be better since you don't need to select multiple options from the list. I would recommend we prioritize building https://github.com/google/android-fhir/issues/764 so you can use that component instead.

shelaghm avatar Sep 22 '22 22:09 shelaghm

@shelaghm I agree.

KhumboLihonga avatar Sep 23 '22 06:09 KhumboLihonga

Closed by https://github.com/google/android-fhir/pull/1722

KhumboLihonga avatar Dec 07 '22 09:12 KhumboLihonga