android-fhir
android-fhir copied to clipboard
Allow typing to filter in the Dropdown widget if drop down has a large number of answer options
Is your feature request related to a problem? Please describe. Currently the drop down widget has the keypad disabled, if we have a large number of answer options, we have to scroll through the entire set to find the answer.
Describe the solution you'd like If the drop down has a large number of answer options, we should enable to keypad to filter. This can also be decided based on the screen size. eg: Small screens can display a fewer number of answer options than large screens. So the number of answer options to allow filtering should not be a hard coded value but should be a function of the screen size.
It is also a good idea to sort the drop down list so that user can visually navigate to the correct value...
Re-opening this for the drop down widget
@joiskash does the autoComplete not solve for this?
Nope, this is related to having a drop down with autocomplete for filtering. In the "autocomplete" widget there is no way to look at all the answer options.
@shelaghm can you help here with a design
@joiskash What is the content in the dropdown? is it the State or LGA example? How many answer options are in the list usually? is it 20, 50, 100? This context is helpful when I'm mocking up designs. Thanks
I'm waiting on seeing the latest APK with the auto complete implementation and then I'll mock this up.
@joiskash @kumaakh Here are some design mocks for this. Please share your feedback.

- Auto pop up the keyboard and show the cursor in the dropdown box after the user presses the dropdown box. Question: Is this the desired behavior to have a preference for search in the dropdown?
- Number of options shown inside the dropdown list are limited to what's visible on the screen when the keyboard is open. In this case only about 5 options visible
- Show a scrollbar inside the dropdown list
This looks great! Yes this is the desired behavior, I think we can decide the show the keyboard if the answer option size is greater than what can be shown on the screen with the keyboard out. This will be useful for devices of different size eg: phone vs tablet.
Thanks for the feedback @joiskash. This issue could solve https://github.com/google/android-fhir/issues/1597 and be a more useful component than the current autocomplete functionality. I suggest we prioritize building this component instead of fixing auto complete.
Some more info on this UI element from material.io
A menu with filtering is also known as autocomplete or a combobox. As the user begins typing, menu options filter based on what's entered. This can help users quickly find the right option from a large list.
Menus with filtering apply dynamic easing to the movement of suggestions as the menu changes height.