filterBy on boolean is not working
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 65/100
- Issue type
- Bug
- Clarity
- Clearly specified
- Activity status
- Stale
- Tech stack
- angularjs, javascript
- Domain
- frontend
Research direction
The issue points to the filter-by.js source file, line 14, where the search value is only processed if it's a string or number. To fix, modify the condition to also handle boolean values. Test by creating a collection with boolean properties and using the filterBy filter to ensure it works correctly. Check existing tests for filter-by to see if any need updating.
Written by the indexing model from the issue text.
Description
Filtering on a boolean property has no effect at all.
Example: $filter('filterBy')(collection, ['property'], true)
Looking at the source we can see that only string and number are allowed.
Line 14: search = (isString(search) || isNumber(search)) ? String(search).toLowerCase() : undefined;
- Dominant language
- JavaScript
- Stars
- 2.9k
- Forks
- 319
- PR merge metrics
- No merged PRs in 30d
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from a8m/angular-filter
-
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
a8m/angular-filter#267 · 1 comment ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
a8m/angular-filter#260 · 1 reaction ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 65/100
a8m/angular-filter#254 · 2 comments · 1 reaction ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 65/100
a8m/angular-filter#250 · 1 comment ·
-
groupBy multiple key Open
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
a8m/angular-filter#177 · 1 comment ·
All issues in a8m/angular-filter
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
HarperFast/skills#96 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
Automattic/studio#4908 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 86/100
sugarlabs/musicblocks#8847 ·
-
client-controller-update ta-bot-triage team-money-movement
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
MetaMask/metamask-mobile#36594 ·