-
Notifications
You must be signed in to change notification settings - Fork 61
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
Scrolling is broken when a custom onServerSearch function Is defined #319
Comments
After a bit of searching, I think this issue could be related to #318 and/or #297. In the meantine, I also created a codepen reprex which might help further narrow down the issue :) |
@sa-si-dev Could you help on this one? |
So the issue is that there is no call to Would it be possible to fix it somewhere in the package? I am not very familiar with JS project structure so I'm not sure where to include it. Edit: So there might be something more going on. In my app, I am using a custom regex function searchLabel(searchValue, virtualSelect) {
...
const regex = new RegExp(`(?<!\S)${word}`, "gi");
...
} and when I call the function ```js
function searchLabel(searchValue, virtualSelect) {
...
virtualSelect.setServerOptions(grouped_data);
virtualSelect.visibleOptionsCount = visible;
virtualSelect.afterSetVisibleOptionsCount();
} The reprex can be found here - https://codepen.io/MichalLauer/pen/wvZQWpe. |
Hi @MichalLauer |
Hi @MichalLauer |
Hey, I am not primarily a JS developer, so I'm not very fluent with npm - I just know the basic stuff. |
Hi @MichalLauer |
Fixed in release v1.0.43. |
Hello, thanks @gnbm for the update and PR! I'm sorry I did not manage to test the changes earlier. I can confirm that the original issue (https://codepen.io/MichalLauer/pen/RwOqWgr) is fixed. However, a custom regex is still not respected in the version 1.0.43 and the previous code reprex on version 1.0.43 does not work - https://codepen.io/MichalLauer/pen/XWQOVpo. There, I am using a custom regex to search and return values (line 5). For example, if you search for "c b a", I want to return all items that contain "c", "b", and "a". The regex correctly identifies them and prints them (lines 8 - 10). However, nothing is printed in the virtual select. Should I create another issue for this? |
Hello @MichalLauer |
Hello,
first of all, thanks for this great package!
I'm trying to implement a custom onServerSearch function, but when a user searches for a specific term, the scroll-down gets broken and all options dissapear. A minimal reprex is here:
If you try to search for "a" and scroll down, the selection breaks. I've been trying to figure this out for the past week but can't seem to get to the bottom of it.
Any idea why this might cause an issue?
Thanks!
The text was updated successfully, but these errors were encountered: