-
Notifications
You must be signed in to change notification settings - Fork 271
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
ui5-input has no way to check to load more items without scrolling #1902
Comments
Hello Scott, how do you fine the following change: to provide an event, let's call it suggestions-scrollable-change, that is fired whenever the suggestions popover scrollable state changes.
This should address the part "the controller can check if the container has a scroll". You would know if the content is scrollable at all from the suggestions-scrollable-change event BR, |
How about instead a public function to check the scrollable status on demand? Any time it writes a new batch of items it can call this function to check on it. Using an event to track the change would require a state tracking outside the input to toggle when the change event fires and makes the implementation more complicated. |
That was my first thought, but when you load new items the DOM is not updated immediately and if you call this method it would return wrong result. But if this is not a problem, we will provide just a method, it is easier for us as well. |
I see, it is no problem as long as there is a reliable way to wait for the correct time to check.
Would the above be sufficient? |
I think it would be sufficient, let's try it this way then. We will provide that method. |
Add a method that returns if the suggestions pop up is currently scrollable or not. Note: the method is async. Note: you need to call the method after the DOM is updated, othwewise you might get wrong result. ```js // ensure the DOM has been updated await window.RenderScheduler.whenFinished(); // check if the suggestions pop up is scrollable const scrollable = await input.isSuggestionsScrollable(); ``` FIXES: #1902
Add a method that returns if the suggestions pop up is currently scrollable or not. Note: the method is async. Note: you need to call the method after the DOM is updated, othwewise you might get wrong result. FIXES: #1902
Added a method, called isSuggestionsScrollable, that returns if the suggestions popup is currently scrollable or not.
// ensure the DOM has been updated - this is one way to wait for it:
await RenderScheduler.whenFinished();
// check if the suggestions pop up is scrollable
const scrollable = await input.isSuggestionsScrollable(); |
Add a method that returns if the suggestions pop up is currently scrollable or not. Note: the method is async. Note: you need to call the method after the DOM is updated, othwewise you might get wrong result. FIXES: #1902
Describe the bug
The controller is taking user input and loading results from server, and once the first page of data is loaded it must check the container is scrolled to the bottom so it can load more items in case there are more; however, this is only possible today on a suggestion-scroll event. What ends up happening is people with large screens are stuck with only the first page and people with small screens can scroll and more pages are added.
Expected behavior
There should be some way to publicly get a handle on the scroll container element in the shadow dom so after inserting some data the controller can check if the container has a scroll and whether or not the scroll is at the bottom or not.
Context
Affected components (if known) input
Log output / Any errors in the console
The text was updated successfully, but these errors were encountered: