geist-org / geist-ui

A design system for building modern websites and applications.
https://geist-ui.dev
MIT License
4.33k stars 334 forks source link

Not able to pass ref down Collapse Component to DOM #620

Closed SBagaria2710 closed 2 years ago

SBagaria2710 commented 3 years ago

Bug report 🐞

Version & Environment

Expected Behaviour

I expected collapse component to have forwardRef in place, so it'd pass my ref to the DOM. I don't think it does. I wish to scroll to a particular collapse component within the collapse group. Since, I am not able to attach a ref to it, hence not able to scroll that collapse into view.

Actual results (or Errors)

I got an error: Warning: Function components cannot be given refs. Attempts to access this ref will fail. Did you mean to use React.forwardRef()?

valenfv commented 3 years ago

Hello everyone! Is this a valid bug/enhancement? If so, can I work on this? Thank you :)

unix commented 2 years ago

Currently forwardRef is only added to a few complex components, and most of the time you don't have to use ref. In what scenario does the Collapse component need to use ref instead of the original controlled component solution?

unix commented 2 years ago

This issue has been closed for a long time without activity, please reopen it if there is an update.