Skip to content

Commit cdfff9f

Browse files
pawelczakpawelczak
authored andcommitted
Merge branch 'damnedest-master'
2 parents d0dcb34 + c762454 commit cdfff9f

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

src/core.js

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -489,14 +489,16 @@ var EasyAutocomplete = (function(scope) {
489489

490490
function checkInputPhraseMatchResponse(inputPhrase, data) {
491491

492-
if (config.get("matchResponseProperty") !== false || typeof config.get("matchResponseProperty") === "string") {
492+
if (config.get("matchResponseProperty") !== false) {
493+
if (typeof config.get("matchResponseProperty") === "string") {
494+
return (data[config.get("matchResponseProperty")] == inputPhrase);
495+
}
493496

494-
if (data[config.get("matchResponseProperty")] == inputPhrase) {
495-
return true;
496-
} else {
497-
return false;
497+
if (typeof config.get("matchResponseProperty") === "function") {
498+
return (config.get("matchResponseProperty")(data) === inputPhrase);
498499
}
499500

501+
return true;
500502
} else {
501503
return true;
502504
}

0 commit comments

Comments
 (0)