Skip to content

Typeahed for pull down

Work in progress, feel free to take over, or close this merge request and make a new one if it's not helpful 😕

Closes #313 (closed)

Please note: The pull down is supposed to have two different behaviours dependent on context. For use cases like the monitoring setup template selection, users type to filter options and then have to select an option. In this case the value only updates (i.e. the onChange method gets called) when one of the options is selected. Typing will not lead to a value change. In other cases, such as medication selection in the edit medication question modal, options are rather suggestions, but users are allowed to enter any value they want. In this case the value has to update when the user types something or selects an option. Which behavior is used is determined by the onChangeMode attribute on the base component, which takes two values: 'select' for value updates only on option selection, or 'type' for value updates on type and on option selection. You can test the first one on the monitoring setup template selection or in the category selection in the question catalogue modal, the second one with the medication selection in the edit medication question modal. When onChangeMode is set to 'type' all option values have to be strings, and the component will throw an error if that is not the case.

Edited by Carlos Sanchez

Merge request reports

Loading