Skip to content
This repository has been archived by the owner on Dec 7, 2021. It is now read-only.

Commit

Permalink
trim before searching
Browse files Browse the repository at this point in the history
  • Loading branch information
adrian-enspired committed Nov 9, 2017
1 parent 6b4fc2f commit 3003348
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/selectr.js
Original file line number Diff line number Diff line change
Expand Up @@ -1172,7 +1172,7 @@
return;
}

// Open the dropdown on [enter], [↓], and [↑] keys
// Open the dropdown on [enter], [ ], [↓], and [↑] keys
if (
e.key === " " ||
(! that.opened && ["Enter", "ArrowUp", "ArrowDown"].indexOf(e.key) > -1)
Expand Down Expand Up @@ -1885,7 +1885,7 @@
// Check the options for the matching string
util.each(this.options, function(i, option) {
var item = this.items[option.idx];
var matches = compare( option.textContent.toLowerCase(), string );
var matches = compare( option.textContent.trim().toLowerCase(), string );

if ( matches && !option.disabled ) {

Expand Down

0 comments on commit 3003348

Please sign in to comment.