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

Input and TextArea ref change was a major breaking change #3631

Closed
jscheel opened this issue May 29, 2019 · 6 comments
Closed

Input and TextArea ref change was a major breaking change #3631

jscheel opened this issue May 29, 2019 · 6 comments
Labels

Comments

@jscheel
Copy link

jscheel commented May 29, 2019

#3453 is a breaking change. If you relied on callback refs before, any ref you have is now broken.

@layershifter
Copy link
Member

Can you please clarify?

TextArea component uses Ref component to get refs, so it doesn't matter which element will be passed. Single case that I see where it can be broken <Input input={{ as: CustomComponent }} />. Am I right?

@jscheel
Copy link
Author

jscheel commented May 29, 2019

Here's a small, contained example:

export function disableLastPass(input) {
  const ref = input && input.inputRef && input.inputRef.current
  if (ref) {
    ref.setAttribute('data-lpignore', 'true')
  }
}

I may just be using this wrong, but it inputRef has changed for me.

@layershifter
Copy link
Member

Please provide whole use case (but it keep it minimal), it seems that I see the wrong usage... Why you need to use refs there at all?

<Input
  ref={input => { input.inputRef /* don't do this, it a private API 💣  */ }} 
/>

@layershifter
Copy link
Member

Closing for housekeeping, will reopen on a reply.

@jscheel
Copy link
Author

jscheel commented Jun 3, 2019

Sorry, been all over the place. I think it's because you need to get to the actual input element, not a ref to the component.

@layershifter
Copy link
Member

Can you please provide the usecase? As I see data-lpignore can be passed via props:

<Input input={{ 'data-lpignore': someCondition ? true : undefined }}

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