Skip to content
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

Duplicate values while filtering #337

Closed
harikrishnan-u01 opened this issue Nov 28, 2017 · 6 comments
Closed

Duplicate values while filtering #337

harikrishnan-u01 opened this issue Nov 28, 2017 · 6 comments

Comments

@harikrishnan-u01
Copy link

harikrishnan-u01 commented Nov 28, 2017

Duplicate values are getting displayed while filtering the results.

Release: v1.6.2

image

image

Plnkr: https://plnkr.co/edit/4TLM3sLKHawfz3BJkM1W?p=preview

Kindly help in providing a fix/work around for this issue as this is a blocker for us.

Thanks,
Hari

@thebf
Copy link
Contributor

thebf commented Nov 28, 2017

I found a workaround:
settings
searchMaxLimit: 0,
searchMaxRenderedItems:5,

Seems to behave like your plunker setup just without the duplicate search results, will keep searching for the root cause.

@thebf
Copy link
Contributor

thebf commented Nov 28, 2017

@gund
I've narrowed it down to searchMaxLimit: as the triggering factor I think it's some error in your search pipe code that was patched in 5 months ago.
Different values changes which values get duplicated in the result set
1300 is duplicated when the searchMaxLimit is set to 4-12 but when set to 3 or 13 it is not duplicated.
When set to 3 3700 is not duplicated while set to 13 it is duplicated.

This smells like a mathematical bug way above my skill level.

@harikrishnan-u01
Copy link
Author

harikrishnan-u01 commented Nov 28, 2017

Hi @thebf
Thank you for the quick responses.

In my project , I have the following settings for muti select:

multiSelectSettings: IMultiSelectSettings = {
enableSearch: true,
checkedStyle: 'fontawesome',
searchRenderLimit: 30,
searchRenderAfter: 1,
searchMaxLimit: 30
};
// Text configuration
multiSelectTexts: IMultiSelectTexts = {
searchPlaceholder: 'Search...',
searchEmptyResult: 'No results found!',
defaultTitle: 'List',
};

I need the searchMaxLimit as 30 since the dataset I have has 5000 records and the application only supported in IE 11 and above.

Is there any other work around which I can use?

Thanks,
Hari

@gund gund mentioned this issue Nov 28, 2017
@gund
Copy link
Collaborator

gund commented Nov 28, 2017

Hey @thebf, thanks for pointing out for the cause.

It was quite crazy to nail down the root cause of the issue but long story short it turned out that each search pass was drifting the cache index (which is used to skip already searched area of the options list) and so on 3rd-4th letter you would start getting those dupes.

The fix now is in PR, but you guys can pull it and test out if you want =)

P.S. I tested the fix right in plunkr but who know what might have happened during copy-paste phase back to the project...

Cheers

@softsimon
Copy link
Owner

Now try with v1.6.3

@harikrishnan-u01
Copy link
Author

Thanks a lot team. This issue has been fixed in v1.6.3.
You guys saved my day 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants