downshift icon indicating copy to clipboard operation
downshift copied to clipboard

fix(type): Nullable setHighlightedIndex

Open miya opened this issue 1 year ago • 2 comments

What:

Changed the argument (index) of setHighlightedIndex from number to number | null.

Why:

The implementation is supposed to allow null, but the interface did not accept null. Also it seems that a pull request implementing an approach that respects null, as also mentioned in #66 has been merged

How:

I've only made corrections to the interface.

Checklist:

  • [x] Documentation
  • [ ] Tests
  • [x] TypeScript Types
  • [ ] Flow Types
  • [ ] Ready to be merged

miya avatar Dec 16 '23 06:12 miya

Why null? What's the use case to use null and not -1?

silviuaavram avatar Dec 29 '23 08:12 silviuaavram

Indeed, I think using -1 should be sufficient. I've adjusted the interface to accommodate the fact that the implementation allows for null. If it's unnecessary, feel free to close.

miya avatar Jan 07 '24 17:01 miya