Skip to content

Comments

fix(type): Nullable setHighlightedIndex#1559

Open
miya wants to merge 3 commits intodownshift-js:masterfrom
miya:fix/nullable-set-highlighted-index
Open

fix(type): Nullable setHighlightedIndex#1559
miya wants to merge 3 commits intodownshift-js:masterfrom
miya:fix/nullable-set-highlighted-index

Conversation

@miya
Copy link

@miya miya commented Dec 16, 2023

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:

  • Documentation
  • Tests
  • TypeScript Types
  • Flow Types
  • Ready to be merged

@silviuaavram
Copy link
Collaborator

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

@miya
Copy link
Author

miya commented Jan 7, 2024

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants