Skip to content

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

@paul-tavares

Description

@paul-tavares

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

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions