diff --git a/index.js b/index.js index b49867a..c758928 100644 --- a/index.js +++ b/index.js @@ -54,7 +54,7 @@ alfy.matches = (input, list, item) => { } if (typeof listItem === 'string') { - listItem = listItem.toLowerCase(); + listItem = listItem.toLowerCase().normalize(); } if (typeof item === 'function') { diff --git a/test/test.js b/test/test.js index a22b868..da0ca92 100644 --- a/test/test.js +++ b/test/test.js @@ -30,4 +30,7 @@ test('.matches()', t => { test('.inputMatches()', t => { t.deepEqual(alfyInstance.inputMatches(['foo', 'unicorn']), ['unicorn']); + alfyInstance.input = 'Ünicörn'; + t.deepEqual(alfyInstance.inputMatches(['foo', 'unicorn']), []); + t.deepEqual(alfyInstance.inputMatches(['foo', 'ünicörn']), ['ünicörn']); });