Closed jsfan3 closed 5 years ago
Wouldn't this be solved by something like:
public void showPopup() {
if(isEditable()) {
super.showPopup();
}
}
No, it doesn't solve. A code like the following has the same issue:
Form hi = new Form("Auto Complete", new BoxLayout(BoxLayout.Y_AXIS));
AutoCompleteTextField ac = new AutoCompleteTextField("Short", "Shock", "Sholder", "Shrek") {
@Override
public void showPopup() {
if (isEditable()) {
super.showPopup();
}
}
};
ac.setMinimumElementsShownInPopup(5);
ac.setText("S");
ac.setEditable(false);
hi.add(ac);
hi.show();
I committed a fix with a new method that should resolve it:
Form hi = new Form("Auto Complete", new BoxLayout(BoxLayout.Y_AXIS));
AutoCompleteTextField ac = new AutoCompleteTextField("Short", "Shock", "Sholder", "Shrek") {
@Override
protected boolean shouldShowPopup() {
return isEditable();
}
};
ac.setMinimumElementsShownInPopup(5);
ac.setText("S");
ac.setEditable(false);
hi.add(ac);
hi.show();
Thank you!
I have a bad news...
Your fix works only in the Simulator.
Web-app -> Doesn't work on Safari and on Android Chrome Android native -> doesn't work Iphone native -> it seems working, but it's a fake: after some random tapping, it replaced the "S" with with "Shock" (like if the popup is present but not visible). After killing and reopening the app, I get the "S" replaced with "Short", tapping under the "S".
I think the server deployment was partial. I just redeployed and it seems to have worked now. Probably fixes #2756 too
No, it's not solved: after your redeployed all the platforms that I tested (Android native, iOS native, web-app) have the same issue: after some random tapping under the "S", it replaced the "S" with with "Shock", "Short", "Sholder" or another word of the list .
The same issue is also in the Simulator, I've just noted it.
This is deployed now, can you see if it resolved the issue?
Thank you. Yes, I tried our test case and now it seems solved in all platforms except the Simulator. I clicked "Update Project Libs", but the bug is still present in the Simulator.
I only updated the servers, updating the simulator will generate download noise for everyone so we'll wait for that next week.
Ok
I understand that
AutoCompleteTextField.setEditable(false)
can seems strange, because usually anAutoCompleteTextField
should be editable. However I need to make it editable or not editable according to the user interactions.More specifically, I expect that an
AutoCompleteTextField
is not editable if it shows the text without any chance to edit it and without showing the autocompleting list. ActuallyAutoCompleteTextField.setEditable(false)
makes the autocompleting list appearing and it allows to select an item to change the text value of theAutoCompleteTextField
.Test case:
Screenshot after tapping the letter
S
:I've already done several attempts to extend the
AutoCompleteTextField
to override the methodsetEditable
to make it working, but without success.