corejavascript / corejavascript/typeahead.js

bug in the intersect function

Open
#170 2 comments 0 reactions 0 assignees View on GitHub
bug
Dominant language
JavaScript
Stars
968
Forks
231
PR merge metrics
No merged PRs in 30d

Description

There is a small bug in the getIntersection function used for filtering results: the two input arrays don't get sorted correctly if arrays contain numeric values as javascript sort function sorts alphabetically. This will affect searches involving multiple tokens.

I suggest sorting array like this

`.sort((a, b) => (a - b));`

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.