I've created a suggest box and generated HTML page with huge text, so I can scroll. 1. Show suggest list 2. Scroll page
The popup box with suggestion list moves with scrolled page, but I want that it will neither hide when page scrolls nor move with page.
As I understand that suggest popup has absolute position. But is there some non css solution.
Answer to:
I've tried add scroll handler to Window, but I've found out that handle only event when I have
and right of them moves, only in this case. If I have one scroll to scroll page like in case with large text - nothing invokes
When constructing a
SuggestBoxyou can provide your ownSuggestOracle,TextBoxandSuggestionDisplay.DefaultSuggestionDisplaycan be used to hide suggestion list. You can do it inWindow.scrollHandler.Here is the code:
Note, that you need to use
DefaultSuggestionDisplay- see documentation on deprecated hideSuggestionList method.I hope that the example explains it all.
I've also checked that if you don't use own
SuggestionDisplayit usesDefaultSuggestionDisplayanyway. So you can do it even simpler.EDIT:
If not the whole window is scrolled but only content of some panel, you can add a
ScrollHandlerto the panel: