How can I auto scroll the GWT SuggestBox
with max-height set on the PopupPanel
holding the SuggestBox
? Currently when the user presses keyboard up keys and down keys styles changes on the suggested items and pressing enter will select the currently selected item on the list.
When the item is located in lower than the max-height scroll bars doesn't scroll.
I tried extending the SuggestBox
and inner class DefaultSuggestionDisplay
to override moveSelectionDown()
and moveSelectionUp()
to explicitly call popup.setScrollTop()
.
In order to do this I need access to the absolute top of the currently selected MenuItem
therefore need access to SuggestionMenu
which is also an inner class of SuggestBox which is private and declared as a private member within DefaultSuggestionDisplay
without getter. Since GWT is a JavaScript we can't use reflection to access it.... Does anyone have a workaround for this issue?
Thanks.
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…