-
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 event when user has scrolled suggestions #1846
Comments
Hello Scott, you can bind for the keyup event and check if ESC is pressed Regarding the additional requirements you have, did you try to use the keyup and focusout events: myInput.addEventListener("keyup", function (event) {
// check event.key
});
myInput.addEventListener("focusout", function (event) {
// handle focusout
}); Best, |
Yes, but I ran into an issue. The focus out event triggers when the user clicks a suggestion, but I need to clear the “transitive search” only when they have “truly focus out” and this focus out event is not “real” because the input will focus back immediately and trigger the item selection event. Also the focus out event occurs before the suggestion item selection event so i can’t distinguish it from the real kind of focus out if the user had clicked somewhere else. |
The "focusout" event used to be fired whenever the user interacts with the suggestion lists, misleading the ones that listens for the event, that the user has clicked somewhere outside. Now, it is not fired. Fixes: #1846
The "focusout" event used to be fired whenever the user interacts with the suggestion lists, misleading the ones that listens for the event, that the user has clicked somewhere outside. Now, it is not fired. Fixes: #1846
Add new event "suggestion-scroll", fired whenever the user scrolls the suggestion list in the popover either via the mouse, or via the keyboard keys. Fixes: #1846
scrollInput.addEventListener("suggestion-scroll", function (event) {
console.log("scroll", { scrollTop: event.detail.scrollTop, container: event.detail.scrollContainer });
}); |
Add new event "suggestion-scroll", fired whenever the user scrolls the suggestion list in the popover either via the mouse, or via the keyboard keys. Fixes: #1846
One missing thing - The use case is like this -- type a search and receive 10 items from the server, if your screen is big enough to fit more items we should go ahead and fetch 10 more items right away. Right now I cannot get a reference to check unless the user scrolls, and the only time the user scrolls is if the window is small - so what ends up happening is the person with the big screen is not able to scroll down to see more items because there was never a scroll bar to begin with. |
Hello @codefactor I see your point, just, could please open a new issue for that to track it easier. Thanks, |
Is your feature request related to a problem? Please describe.
We have a requirement that when the user has scrolled near to the bottom of the suggestion list that we need to load in more suggestions from the server. This can be achieved today but only by breaking encapsulation.
Also - for keyboard only accessibility - the user needs to scroll down the search suggestions to see what is available - though he does see the text change, but I don't think that is enough.
Describe the solution you'd like
It would be good to have this as a public event directly from the
<ui5-input>
tag -- maybe something like this:The suggestion scroll event could give a reference to the
this.Suggestion._getScrollContainer()
so that the caller can check the scroll position if it is near the bottom.edit:
We also need a callback when the user presses escape key or focus out, some sort of event when the search should clear the previous "transitive search".
Describe alternatives you've considered
onAfterRendering get a handle on
input.Suggestions._getScrollContainer()
Promise and manually attach the scroll event listener.Additional context
Add any other context or screenshots about the feature request here.
The text was updated successfully, but these errors were encountered: