Skip to content

Commit

Permalink
fix(filterable-select): check event has a data element attribute befo…
Browse files Browse the repository at this point in the history
…re checking the value

Adds a guard to check that `event.target.attributes["data-element"]` is not undefined before
checking if the value is `"input"`

fix #3754
  • Loading branch information
edleeks87 committed Apr 6, 2021
1 parent 177fc75 commit 39db098
Showing 1 changed file with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -388,7 +388,10 @@ const FilterableSelect = React.forwardRef(
function handleTextboxMouseDown(event) {
isMouseDownReported.current = true;

if (event.target.attributes["data-element"].value === "input") {
if (
event.target.attributes["data-element"] &&
event.target.attributes["data-element"].value === "input"
) {
isMouseDownOnInput.current = true;
}
}
Expand Down

0 comments on commit 39db098

Please sign in to comment.