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

Dropdown: Unmounting focused dropdown throws TypeError #3179

Closed
kalinkrustev opened this issue Aug 24, 2022 · 1 comment · Fixed by #3180
Closed

Dropdown: Unmounting focused dropdown throws TypeError #3179

kalinkrustev opened this issue Aug 24, 2022 · 1 comment · Fixed by #3180
Assignees
Labels
Type: Bug Issue contains a defect related to a specific component.
Milestone

Comments

@kalinkrustev
Copy link
Contributor

kalinkrustev commented Aug 24, 2022

Describe the bug

This is caused by #3164, where no check is made if inputRef.current has a value.

Reproducer

https://codesandbox.io/s/primereact-test-forked-lyjh4k

PrimeReact version

8.4.0

React version

18.x

Language

ALL

Build / Runtime

Create React App (CRA)

Browser(s)

No response

Steps to reproduce the behavior

Open the CodeSandbox, click the Dropdown, so that it is focused and then click the button.
This will hide the Dropdown and cause the error.

Expected behavior

Maybe in this case the onBlur should still be called with the value properties = undefined.

@kalinkrustev kalinkrustev added the Status: Needs Triage Issue will be reviewed by Core Team and a relevant label will be added as soon as possible label Aug 24, 2022
@melloware melloware self-assigned this Aug 24, 2022
@melloware melloware added this to the 8.5.0 milestone Aug 24, 2022
melloware added a commit to melloware/primereact that referenced this issue Aug 24, 2022
@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 Aug 24, 2022
@melloware
Copy link
Member

OK sorry about that can you review my PR?

@melloware melloware changed the title Unmounting focused Dropdown throws TypeError Dropdown: Unmounting focused dropdown throws TypeError Aug 24, 2022
melloware added a commit to melloware/primereact that referenced this issue Aug 24, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: Bug Issue contains a defect related to a specific component.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants