Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 10 additions & 2 deletions app/src/org/commcare/views/widgets/ComboboxWidget.java
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ public class ComboboxWidget extends QuestionWidget {
private Vector<SelectChoice> choices;
private Vector<String> choiceTexts;
private Combobox comboBox;
private boolean wasWidgetChangedOnTextChanged = false;

public ComboboxWidget(Context context, FormEntryPrompt prompt, ComboboxFilterRule filterRule) {
super(context, prompt);
Expand Down Expand Up @@ -95,7 +96,12 @@ public void onTextChanged(CharSequence s, int start, int before, int count) {

@Override
public void afterTextChanged(Editable s) {
widgetEntryChanged();
try {
wasWidgetChangedOnTextChanged = true;
widgetEntryChanged();
} finally {
wasWidgetChangedOnTextChanged = false;
}
}
});
}
Expand All @@ -115,7 +121,9 @@ private void fillInPreviousAnswer(FormEntryPrompt prompt) {
@Override
public IAnswerData getAnswer() {
// So that we can see any error message that gets shown as a result of this
comboBox.dismissDropDown();
if(!wasWidgetChangedOnTextChanged) {
comboBox.dismissDropDown();
}

comboBox.autoCorrectCapitalization();
String enteredText = comboBox.getText().toString();
Expand Down