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

[v4] TypeError: n.mainRef.blur is not a function #303

Closed
jeroenransijn opened this issue Aug 24, 2018 · 1 comment
Closed

[v4] TypeError: n.mainRef.blur is not a function #303

jeroenransijn opened this issue Aug 24, 2018 · 1 comment
Labels

Comments

@jeroenransijn
Copy link
Contributor

jeroenransijn commented Aug 24, 2018

Culprit

evergreen-v4/esm/table/src/TableRow in apply

TableRow uses innerRef, but when using the is prop, you might not have a component that supports ref.
The Link component from react-router actually implements the same innerRef API as in ui-box/ Evergreen. In this case TableRow gets a ref that is actually a React component. As we are trying to assist focus management with things such as this.mainRef.blur things start to break

There are a couple of things we could do:

<Box is={({ getRef,  ...props }) => <RRLink innerRef={getRef} {...props} />} />

That seems asking for problems, but might solve this use case

The other way could be to make sure we are dealing with a real element in TableRow — and other components that make the assumption of seeing a element.

There might be some ways we could use the new React.forwardRef to help with this problem.

@jeroenransijn jeroenransijn changed the title [v4 ]TypeError: n.mainRef.blur is not a function [v4] TypeError: n.mainRef.blur is not a function Aug 24, 2018
@stale
Copy link

stale bot commented Mar 11, 2019

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the wont-fix label Mar 11, 2019
@mshwery mshwery closed this as completed Oct 24, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants