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

Components: Cannot access ref #2963

Closed
melloware opened this issue Jun 5, 2022 · 0 comments · Fixed by #3047 or #3077
Closed

Components: Cannot access ref #2963

melloware opened this issue Jun 5, 2022 · 0 comments · Fixed by #3047 or #3077
Assignees
Labels
Type: Bug Issue contains a defect related to a specific component.
Milestone

Comments

@melloware
Copy link
Member

melloware commented Jun 5, 2022

Describe the bug

Ref is no longer accessible in Dropdown and many other components. This code used to work in 7.1

<Dropdown ref={myRef}  />

in 8.0 does nothing and ref is not accessible.

Reproducer

https://codesandbox.io/s/primereact-test-forked-xztbhk?file=/src/index.js

PrimeReact version

8.1.1

React version

18.x

Language

ALL

Build / Runtime

Create React App (CRA)

Browser(s)

ALL

Steps to reproduce the behavior

  1. Run the above reproducer.
  2. See that ref has no values and can't be accessed.

From looking in the DropDown.js source code I can see the original `ref is never used.

Expected behavior

The ref element to contain the value

@melloware melloware added Type: Bug Issue contains a defect related to a specific component. Status: Needs Triage Issue will be reviewed by Core Team and a relevant label will be added as soon as possible labels Jun 5, 2022
@melloware melloware changed the title Dropdown: Cannot access ref Components: Cannot access ref Jun 7, 2022
@melloware melloware removed the Status: Needs Triage Issue will be reviewed by Core Team and a relevant label will be added as soon as possible label Jun 7, 2022
@melloware melloware self-assigned this Jun 7, 2022
@melloware melloware added this to the 8.2.0 milestone Jun 7, 2022
melloware added a commit to melloware/primereact that referenced this issue Jun 7, 2022
@mertsincan mertsincan modified the milestones: 8.2.0, 9.0.0 Jul 6, 2022
melloware added a commit to melloware/primereact that referenced this issue Jul 9, 2022
melloware added a commit to melloware/primereact that referenced this issue Jul 9, 2022
melloware added a commit to melloware/primereact that referenced this issue Jul 13, 2022
mertsincan added a commit that referenced this issue Jul 18, 2022
Co-authored-by: mertsincan <sincan.mert@gmail.com>
@mertsincan mertsincan modified the milestones: 9.0.0, 8.3.0 Jul 18, 2022
mertsincan added a commit that referenced this issue Jul 18, 2022
mertsincan added a commit that referenced this issue Jul 18, 2022
@mertsincan mertsincan modified the milestones: 8.3.0, 9.0.0 Jul 18, 2022
@mertsincan mertsincan reopened this Jul 18, 2022
melloware added a commit to melloware/primereact that referenced this issue Jul 18, 2022
melloware added a commit to melloware/primereact that referenced this issue Jul 18, 2022
mertsincan added a commit that referenced this issue Jul 18, 2022
* Fix #2963: Expose ref and element

* Fix #2963: DomHandler check for Ref object

* Fix #2963: InputText/InputTextArea/Button remove imperative handle

Co-authored-by: mertsincan <sincan.mert@gmail.com>
@mertsincan mertsincan removed this from the 9.0.0 milestone Jul 18, 2022
@mertsincan mertsincan added this to the 8.3.0 milestone Jul 18, 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
2 participants