Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[FilterableSelect] Error thrown on mouse down #3754

Closed
stripeyjumper opened this issue Feb 25, 2021 · 2 comments · Fixed by #3873
Closed

[FilterableSelect] Error thrown on mouse down #3754

stripeyjumper opened this issue Feb 25, 2021 · 2 comments · Fixed by #3873

Comments

@stripeyjumper
Copy link
Contributor

Current behaviour

When clicking on the select component it intermittently throws an error.

Expected behaviour

It should not throw an error

Reproducible example

https://codesandbox.io/s/cocky-napier-jmfe6?file=/src/index.js

Suggested solution(s)

The component does not check for the existence of the data-element attribute on the target element before inspecting its value.
See here:

if (event.target.attributes["data-element"].value === "input") {

Your environment

Software Version(s)
carbon-react 66.11.1
react-scripts 3.4.4
React 16.8.3
Browser Chrome
npm 6.14.4
Operating System MacOS
@stripeyjumper stripeyjumper added Bug triage Triage Required labels Feb 25, 2021
@samtjo
Copy link
Contributor

samtjo commented Mar 4, 2021

FE-3802

@samtjo samtjo added On Backlog and removed triage Triage Required labels Mar 4, 2021
edleeks87 added a commit that referenced this issue Apr 6, 2021
…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
carbonci pushed a commit that referenced this issue Apr 8, 2021
### [68.9.1](v68.9.0...v68.9.1) (2021-04-08)

### Bug Fixes

* **filterable-select:** check event has a data element attribute before checking the value ([39db098](39db098)), closes [#3754](#3754)
@carbonci
Copy link
Collaborator

carbonci commented Apr 8, 2021

🎉 This issue has been resolved in version 68.9.1 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
3 participants