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

[BUG] EuiFieldText component inputRef prop is never set #3798

Closed
paul-tavares opened this issue Jul 23, 2020 · 0 comments · Fixed by #3822
Closed

[BUG] EuiFieldText component inputRef prop is never set #3798

paul-tavares opened this issue Jul 23, 2020 · 0 comments · Fixed by #3822
Assignees
Labels

Comments

@paul-tavares
Copy link

The inputRef prop seems to never be set on the EuiFieldText component - an error is output to the console:

Warning: Failed prop type: Invalid prop `children.ref` of type `object` supplied to `EuiValidatableControl`, expected `function`.
    in EuiValidatableControl (created by EuiFieldText)
    in EuiFieldText (created by StepDefinePackageConfig)
    in div (created by EuiFormRow)

Code looks something like this:

const packageNameInput = useRef<HTMLInputElement>(null);
//....
<EuiFieldText
  value={packageConfig.name}
  onChange={(e) =>
    updatePackageConfig({
      name: e.target.value,
    })
  }
  inputRef={packageNameInput}
  data-test-subj="packageConfigNameInput"
/>

Ref: https://github.com/elastic/kibana/blob/82f6c6a1df9168b104227e999d927ea500bb11cc/x-pack/plugins/ingest_manager/public/applications/ingest_manager/sections/agent_config/create_package_config_page/step_define_package_config.tsx#L106

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants