-
Notifications
You must be signed in to change notification settings - Fork 428
Closed
Description
@shannah Currently on Android (Not able to reproduce this on the simulator) when selecting an item on the autocompletetextcomponent causes the field to disfigure the selected item on the field itself by adding/subtracting letters of the selected item.
Below is the test case and screenshot
import static com.codename1.ui.CN.*;
import com.codename1.ui.Form;
import com.codename1.ui.Dialog;
import com.codename1.ui.plaf.UIManager;
import com.codename1.ui.util.Resources;
import com.codename1.io.Log;
import com.codename1.ui.Toolbar;
import com.codename1.ui.layouts.BoxLayout;
import com.codename1.ui.AutoCompleteTextComponent;
import com.codename1.ui.list.DefaultListModel;
import com.codename1.ui.list.ListModel;
public class MyApplication {
private Form current;
private Resources theme;
public void init(Object context) {
// use two network threads instead of one
updateNetworkThreadCount(2);
theme = UIManager.initFirstTheme("/theme");
// Enable Toolbar on all Forms by default
Toolbar.setGlobalToolbar(true);
// Pro only feature
Log.bindCrashProtection(true);
addNetworkErrorListener(err -> {
// prevent the event from propagating
err.consume();
if(err.getError() != null) {
Log.e(err.getError());
}
Log.sendLogAsync();
Dialog.show("Connection Error", "There was a networking error in the connection to " + err.getConnectionRequest().getUrl(), "OK", null);
});
}
public void start() {
if(current != null){
current.show();
return;
}
Form hi = new Form("Hi World", BoxLayout.y());
AutoCompleteTextComponent.AutoCompleteFilter po = text -> {
if (text.trim().length() <= 1) {
return false;
}
return true;
};
ListModel<String> li=new DefaultListModel<>("Red","Green","Blue");
AutoCompleteTextComponent act = new AutoCompleteTextComponent(li,po);
hi.add(act);
hi.show();
}
public void stop() {
current = getCurrentForm();
if(current instanceof Dialog) {
((Dialog)current).dispose();
current = getCurrentForm();
}
}
public void destroy() {
}
}
Metadata
Metadata
Assignees
Labels
No labels