1

I'm using PrimeReact AutoComplete component:

<AutoComplete
  id='parent-autocomplete'
  value={parent}
  onChange={(e) => setParent(e.value)}
  suggestions={filteredGroups}
  completeMethod={searchGroup}
  field='name'
  dropdown
></AutoComplete>

I added an id for the component but it doesn't assign it to the input inside the component.

I need this id to check it has a value if it's specified as required.

How can I add an id for the input inside the component?

Mehdi Rahimi
  • 1,453
  • 5
  • 20
  • 31

1 Answers1

1

I found a solution in this link but not directly:

To assign id for Autocomplete input field just add this prop:

inputId="optional-id"
Mehdi Rahimi
  • 1,453
  • 5
  • 20
  • 31