Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix bug where page does not get reset when redrawing suggest list #45

Open
wants to merge 7 commits into
base: tardis
Choose a base branch
from
Open
Show file tree
Hide file tree
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
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,9 @@ protected Widget decorateSuggestionList(Widget suggestionList) {
scrollPanel.setWidget(suggestionList);

scrollPanel.setHeight(Window.getClientHeight() / 3 + "px");

// Commenting this out lets it dynamically resize

// This will cause the box to dynamically resize based on the largest element of the list.
// If this is present it will cause it to stick at 150px
// scrollPanel.setWidth("150px");
Expand Down Expand Up @@ -304,6 +307,7 @@ public void onFocus(FocusEvent event) {
@Override
public void onBlur(BlurEvent event) {
active = false;
scrollDisplay.page = 0;
}
});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,10 @@ static class LocalSuggestionDisplay extends DefaultSuggestionDisplay {
public Widget getMenu() {
return getPopupPanel().getWidget();
}

public Widget getMyPopupPanel() {
return getPopupPanel();
}
}

final LocalSuggestionDisplay suggestionDisplay = new LocalSuggestionDisplay();
Expand All @@ -133,6 +137,8 @@ public Widget getMenu() {
public CommandSuggestBox(BaseSqlWidget p) {
this.widget = p;

suggestionDisplay.getMyPopupPanel().addStyleName("gwt-columnPicker");

suggestBox.getValueBox().addFocusHandler(new FocusHandler() {
@Override
public void onFocus(FocusEvent event) {
Expand Down