Skip to content

Commit

Permalink
Fixed issue with AutocompleteTextField popup not adjusting its height…
Browse files Browse the repository at this point in the history
… when its options list changes.
  • Loading branch information
shannah committed Mar 5, 2018
1 parent 7ba4c54 commit 0d49314
Showing 1 changed file with 12 additions and 17 deletions.
29 changes: 12 additions & 17 deletions CodenameOne/src/com/codename1/ui/AutoCompleteTextField.java
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,7 @@ protected void updateFilterList() {
popup.setVisible(v);
popup.setEnabled(v);
f.repaint();
}
}
if(f != null) {
dontCalcSize = false;
f.revalidate();
Expand Down Expand Up @@ -217,23 +217,18 @@ private boolean filterImpl(String text) {
popup.getComponentAt(0).setScrollY(0);
popup.setVisible(v);
popup.setEnabled(v);
Form f = getComponentForm();
if(f != null) {
if(popup.getHeight() < f.getContentPane().getHeight()/2){
int popupHeight = calcPopuupHeight((List)popup.getComponentAt(0));
popup.setHeight(popupHeight);
dontCalcSize = false;
popup.forceRevalidate();
dontCalcSize = true;
f.repaint();
}
}
}
Form f = getComponentForm();

if(!v) {
if(f != null) {
f.repaint();
}
}
if (popup.getComponentCount() > 0) {
int popupHeight = calcPopuupHeight((List)popup.getComponentAt(0));
popup.setHeight(popupHeight);
dontCalcSize = false;
popup.forceRevalidate();
dontCalcSize = true;
}
if (f != null) {
f.repaint();
}
}
return res;
Expand Down

0 comments on commit 0d49314

Please sign in to comment.