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

[Button] [ButtonLink] [Link] Support ref on Button / Link components #435

Closed
4 tasks
heathervv opened this issue Nov 28, 2017 · 6 comments
Closed
4 tasks
Labels
priority: high High priority items, users are affected, and the core team will prioritize status: completed ✅ An item that has been closed, due to its completion type: enhancement enhancement or new requests

Comments

@heathervv
Copy link

Description

  • Using React's ref attribute returns null when used on ButtonLink. Haven't tested on all other Button/Link type components, but I would assume it happens on them as well. It'd be great if these could support the ref attribute [ref={ (input) => { this.button = input } }] so that it's possibly to reference (and focus!) on the button for accessibility purposes.

Reproduction Steps

  • Add ButtonLink component to app
  • Add ref attribute ex ref={ (input) => { this.button = input } }
  • Call this.button
  • Observe that it returns null and no reference to DOM element

Version Number of TDS

0.29.0

@ryanoglesby08
Copy link
Contributor

ryanoglesby08 commented Nov 28, 2017

Thanks for the issue! Was looking into this a little bit this morning. I think this is also applicable to all our interactive components (Link, Button, Input, etc), so I'd like to drive towards a holistic solution.

Looking at the React docs, this seems to be the right path: https://reactjs.org/docs/refs-and-the-dom.html#exposing-dom-refs-to-parent-components

@theetrain theetrain added the type: enhancement enhancement or new requests label Dec 14, 2017
@stale
Copy link

stale bot commented Feb 21, 2018

This issue has been automatically marked as stale because it has not had recent activity. The core team will be inclined to provide an update soon. If there is no activity after a few months, this issue will be closed. Thank you for your contributions.

@stale stale bot added the stale label Feb 21, 2018
@ryanoglesby08 ryanoglesby08 changed the title Support ref on Button / Link components [Button] [ButtonLink] [Link] Support ref on Button / Link components Mar 8, 2018
@stale stale bot removed the stale label Mar 8, 2018
@ryanoglesby08
Copy link
Contributor

This recent React RFC for "innerRef" should make this feature much much easier! reactjs/rfcs#17

@theetrain theetrain added this to the Spring Cleaning Q2 2018 milestone Apr 25, 2018
@marcod1419
Copy link
Contributor

Hi @heathervv, I can't seem to reproduce this issue. Is this still a problem for you?

@heathervv
Copy link
Author

@marcod1419 I haven't tested for this bug since March - we either didn't use TDS components if we required this feature, or sacrificed using refs! Sorry but I'm not able to tell you whether or not it's an issue still.

@marcod1419
Copy link
Contributor

@heathervv Thanks for the quick response! I'll close this issue for now then. If you or your team ever come across it again, feel free to comment on here again and we'll take another look.

@varunj90 varunj90 added priority: high High priority items, users are affected, and the core team will prioritize status: completed ✅ An item that has been closed, due to its completion labels Jun 12, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
priority: high High priority items, users are affected, and the core team will prioritize status: completed ✅ An item that has been closed, due to its completion type: enhancement enhancement or new requests
Projects
None yet
Development

No branches or pull requests

5 participants