-
Notifications
You must be signed in to change notification settings - Fork 331
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
[Autocomplete-js npm] result panel leaving space and go down on each page scroll #904
Comments
No, not this sorry. it is leaving more and more space on each page scroll event. so for reproduce it you will need long page where window scroll is exist and then you can do one scroll and see panel position and then do one more scroll down and see panel position. Hope it make sense. |
I can't reproduce it yet here, could you clarify? https://codesandbox.io/s/determined-dijkstra-ulp2g1?file=/index.html |
so here is the demo https://yu6nvd.csb.app/ |
Looks like this part of the code is responsible of setting a top value on the panel, which indeed should be tracking the input, not the whole page's scroll
|
Yeah, Any quick fix / solution will be helpful. Thanks for investigating ! |
So for information, it is properly working with version "1.0.0-alpha.49" |
A workaround is to set the top position manually: https://codesandbox.io/s/sweet-tesla-v8m0y9?file=/src/autocomplete.tsx |
Yeah, can you share more info or code snippet sorry! |
@ronty123, the code snippet is in the link I shared: https://codesandbox.io/s/sweet-tesla-v8m0y9?file=/src/autocomplete.tsx:6772-7079 render({ children }, root) {
// hardcoded fix for https://github.com/algolia/autocomplete/issues/904
const container = document.querySelector("#autocomplete");
const rect = container.getBoundingClientRect();
root.style.top = rect.top + rect.height + "px";
render(children, root);
}, |
Thanks mate, cheers! |
Have you been able to solve the problem? I have the exact same problem |
Yes, it was fixed for me with above solution |
Description
[Autocomplete-js npm] result panel leaving space and go down on each page scroll
Reproduction
go to chrome browser demo where page height is more than screen size and autocomplete input is at top and then scroll one or two time and then click and search. the result will show at little down of autocomplete input
Expected behavior
it should open just attached to autocomplete input
Environment
The text was updated successfully, but these errors were encountered: