Skip to content

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

Closed

Description

@arnodemer

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.

Activity

  1. added a commit that references this issue on Mar 20, 2024
  2. added this to the 10.6.0 milestone on Mar 20, 2024
  3. melloware commented on Mar 21, 2024

    @melloware
    Member

    Why did you close your PR?

  4. added a commit that references this issue on Mar 21, 2024
  5. arnodemer commented on Mar 21, 2024

    @arnodemer
    ContributorAuthor

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

  6. added a commit that references this issue on Mar 21, 2024
    252b86f
  7. melloware commented on Mar 21, 2024

    @melloware
    Member

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

  8. added a commit that references this issue on Mar 21, 2024
    99ae3d3
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions