Add ===null to all filter params
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 70/100
- Issue type
- Bug
- Clarity
- Clearly specified
- Activity status
- Stale
- Tech stack
- angularjs, javascript
- Domain
- frontend
Research direction
Look at the fuzzyBy filter in the angular-filter source code. The issue points to a specific conditional check. Find all filter parameters that use isUndefined and change them to check for null with == null. Test by setting an input to null and verifying the filter returns the collection instead of nothing.
Written by the indexing model from the issue text.
Description
Currently the (in my instance) fuzzyBy filter has this code in it
if(!isArray(collection) || isUndefined(property)
|| isUndefined(search)) {
return collection;
}
Search is the key word. Now say i have this value modeled to an input, when the input is blank it is set to null, but angular.isUndefined() does a typeof check on the value, not a ==undefined, or ==null.
Because of this whenever the input is blank nothing is returned by the filter. This is not the desired result is it?
This is simply fixed by changing the above to
if(!isArray(collection) || isUndefined(property)
|| search == null) {
return collection;
}
Because ==null will evaluate to true if search is null or undefined this should fit the bill here.
Are there any downsides to doing this everywhere?
- 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 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 65/100
a8m/angular-filter#208 · 1 comment · 1 reaction ·
All issues in a8m/angular-filter
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
HarperFast/skills#96 ·
-
[Block] Latest Posts [Type] Bug
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
-
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 ·