Skip to content

Commit

Permalink
trim filterText before validating it
Browse files Browse the repository at this point in the history
  • Loading branch information
ahmedhamidawan committed Mar 20, 2024
1 parent 8522a01 commit e8fc803
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions client/src/utils/filtering.ts
Original file line number Diff line number Diff line change
Expand Up @@ -399,6 +399,7 @@ export default class Filtering<T> {
* @returns Filters as 2D array of of [field, value] pairs
* */
getFiltersForText(filterText: string, removeAny = true, validate = true): [string, T][] {
filterText = filterText.trim();
const pairSplitRE = this.quoteStrings
? /[^\s'"]+(?:['"][^'"]*['"][^\s'"]*)*|(?:['"][^'"]*['"][^\s'"]*)+/g
: /(\S+):(.*?)(?=\s+\S+:|$)/g;
Expand Down

0 comments on commit e8fc803

Please sign in to comment.