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

ListBox: throw undefined error calling preventDefault() when running jest tests. #6184

Closed
arnodemer opened this issue Mar 20, 2024 · 3 comments · Fixed by #6206
Closed

ListBox: throw undefined error calling preventDefault() when running jest tests. #6184

arnodemer opened this issue Mar 20, 2024 · 3 comments · Fixed by #6206
Assignees
Labels
Component: Test Issue or pull request is related to Component Testing
Milestone

Comments

@arnodemer
Copy link
Contributor

Describe the bug

Error undefined calling preventDefault() is raised for ListBox onChange callback when callback calls e.preventDefault.
Because onChange originalEvent is undefined (at least when running jest tests, got error at listbox.cjs.js around line 483)

Reproducer

No response

PrimeReact version

10.5.3

React version

17.x

Language

TypeScript

Build / Runtime

Create React App (CRA)

Browser(s)

No response

Steps to reproduce the behavior

Not easy to provide reproducer nor steps to reproduce.

Expected behavior

no error should be raised.

@arnodemer arnodemer added the Status: Needs Triage Issue will be reviewed by Core Team and a relevant label will be added as soon as possible label Mar 20, 2024
arnodemer added a commit to HCL-TECH-SOFTWARE/primereact that referenced this issue Mar 20, 2024
@melloware melloware added Type: Bug Issue contains a defect related to a specific component. and removed Status: Needs Triage Issue will be reviewed by Core Team and a relevant label will be added as soon as possible labels Mar 20, 2024
@melloware melloware added this to the 10.6.0 milestone Mar 20, 2024
@melloware
Copy link
Member

Why did you close your PR?

@arnodemer
Copy link
Contributor Author

By Bad, I delete local branch .
I create another PR:
#6205

melloware added a commit to melloware/primereact that referenced this issue Mar 21, 2024
@melloware melloware added Component: Test Issue or pull request is related to Component Testing and removed Type: Bug Issue contains a defect related to a specific component. labels Mar 21, 2024
@melloware
Copy link
Member

I actually submitted one that fixes all instances of this and not just in ListBox.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Component: Test Issue or pull request is related to Component Testing
Projects
None yet
2 participants