Skip to content

Commit ffdd20b

Browse files
fix(table): fix filter and search with blanks (T-Systems-MMS#41)
1 parent 0ffac77 commit ffdd20b

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

Phonebook.Frontend/src/app/modules/table/table-logic.ts

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -91,12 +91,13 @@ export class TableLogic {
9191

9292
/**
9393
* Prepares the Search String by
94-
* 1. Removing Spaces and Commas
95-
* 2. Escaping RegEx Characters
94+
* 1. Removing Commas
95+
* 2. Trimming whitespace
96+
* 3. Escaping RegEx Characters
9697
* @param str String to prepare
9798
*/
9899
public static prepareSearchString(str: string): RegExp {
99-
return TableLogic.escapeRegExp(str.replace(/[\s,]/g, ''));
100+
return TableLogic.escapeRegExp(str.replace(/,/g, '').trim());
100101
}
101102
}
102103

0 commit comments

Comments
 (0)