Thank you for the suggestion.
I have copied com.google.gwt.user.client.ui.SuggestBox in my codebase
and made the following changes and it works as expected.
public static class DefaultSuggestionDisplay extends SuggestionDisplay
implements HasAnimation {
private ScrollPanel scrollPanel;
protected Widget decorateSuggestionList(Widget suggestionList) {
scrollPanel = new ScrollPanel(suggestionList);
scrollPanel.setStyleName("suggestScrollContent");
return scrollPanel;
}
protected void moveSelectionDown() {
if (isSuggestionListShowing()) {
suggestionMenu.selectItem(suggestionMenu.getSelectedItemIndex() + 1);
if (scrollPanel != null) {
scrollPanel.ensureVisible(suggestionMenu.getSelectedItem());
}
}
}
protected void moveSelectionUp() {
if (isSuggestionListShowing()) {
if (suggestionMenu.getSelectedItemIndex() == -1) {
suggestionMenu.selectItem(suggestionMenu.getNumItems() - 1);
} else {
suggestionMenu.selectItem(suggestionMenu.getSelectedItemIndex() - 1);
}
if (scrollPanel != null) {
scrollPanel.ensureVisible(suggestionMenu.getSelectedItem());
}
}
}
}
}
.suggestScrollContent{
height:auto;
width:auto !important;
max-width:400px;
max-height: 165px;
overflow-y: auto;
padding-right:18px;
}
On May 2, 3:53 pm, Jens <[email protected]> wrote:
> You probably have to implement your own SuggestionDisplay and add some
> logic to moveSelectionDown/moveSelectionUp to also adjust your scrollable
> container. You have made the container scrollable, so you must also
> implement your desired scrolling behavior.
>
> -- J.
>
> Am Mittwoch, 2. Mai 2012 08:39:16 UTC+2 schrieb ALB-PSP-DV1:
>
>
>
>
>
>
>
>
>
> > We have a suggestbox with approx. 50 suggestions. We are displaying a
> > scrollbar for the suggestbox using the following css
>
> > .suggestPopupContent{
> > height:auto;
> > width:auto !important;
> > max-width:400px;
> > max-height: 165px;
> > overflow-y: auto;
> > padding-right:18px;
> > }
>
> > Now when the user tries to navigate through the suggestions using the
> > Up/Down arrow key, the suggestions not within the current visible area
> > are not displayed.
>
> > Thanks in advance.
--
You received this message because you are subscribed to the Google Groups
"Google Web Toolkit" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/google-web-toolkit?hl=en.