Skip to content

Commit

Permalink
Fix filtering issues for string in different locales (T1242756)
Browse files Browse the repository at this point in the history
  • Loading branch information
GoodDayForSurf committed Aug 30, 2024
1 parent 1a7120c commit 8a939d9
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
2 changes: 1 addition & 1 deletion packages/devextreme/js/core/utils/data.js
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,7 @@ export const toComparable = function(value, caseSensitive, langParams = {}, opti
} else if(typeof value === 'string' && collatorSensitivity === 'base') {
const REMOVE_DIACRITICAL_MARKS_REGEXP = /[\u0300-\u036f]/g;

value = value.normalize('NFD').replace(REMOVE_DIACRITICAL_MARKS_REGEXP, '');
value = toLowerCase(value, langParams).normalize('NFD').replace(REMOVE_DIACRITICAL_MARKS_REGEXP, '');
}

const isCaseSensitive = caseSensitive || collatorSensitivity === 'case';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7724,9 +7724,8 @@ QUnit.module('DataSource with diacritical marks', {
assert.deepEqual(dataSource.items()[2], { id: 3, city: 'İZMİR' }, 'third item');
} else {
// assert
assert.strictEqual(dataSource.items().length, 2, 'item count');
assert.deepEqual(dataSource.items()[0], { id: 2, city: 'İzmi̇r' }, 'first item');
assert.deepEqual(dataSource.items()[1], { id: 3, city: 'İZMİR' }, 'second item');
assert.strictEqual(dataSource.items().length, 1, 'item count');
assert.deepEqual(dataSource.items()[0], { id: 3, city: 'İZMİR' }, 'second item');
}
});

Expand Down

0 comments on commit 8a939d9

Please sign in to comment.