2

I'm trying to override the default ids that Downshift provides.

I tried passing the id through getInputProps() like the docs suggest but it did not work.

{...getInputProps({ inputId: 'my-input-id' })}

Passing the id directly to the input did not work as well.

<input id='my-input-id />

In both cases, the id remains downshift-0-input. Any ideas on how I can override this id?

  • I'm trying to figure out why you're doing `inputId: 'my-input-id'` instead of `id: 'my-input-id'`... – code Oct 15 '22 at 05:51
  • Documentation mentions this, adding `inputId: 'my-input-id'` sets id to the input https://github.com/downshift-js/downshift#inputid – Neha-Rajesh Oct 17 '22 at 04:31

1 Answers1

0

Seems like the documentation is wrong. However the TypeScript types are correct and I just tested and simply passing id works:

{...getInputProps({ id: 'my-input-id' })}
KevinH
  • 1,066
  • 1
  • 14
  • 17