Skip to content

Commit

Permalink
Merge pull request #84 from adan-ferguson/target-selection-fix
Browse files Browse the repository at this point in the history
Fix result item selection error if a descendant element is clicked
  • Loading branch information
TarekRaafat authored Nov 2, 2019
2 parents 487174c + 821df50 commit 57836ef
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/views/autoCompleteView.js
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ const onSelection = (event, field, resultsList, feedback, resultsValues, selecti
if (event.keyCode === keys.ENTER) {
return value.index === Number(selection.getAttribute(dataAttribute));
} else if (event.type === "mousedown") {
return value.index === Number(event.target.getAttribute(dataAttribute));
return value.index === Number(event.currentTarget.getAttribute(dataAttribute));
}
}),
});
Expand Down

0 comments on commit 57836ef

Please sign in to comment.