Update TS typings for selectedItem to accept null in both useSelect and useCombobox.
To migrate to the new change, update your types or code if necessary. selectedItem, defaultSelectedItem and initialSelectedItem now have Item | null instead of Item type. PR with the changes: downshift-js/downshift#1090
Update TS typings for itemToString to accept null for the item parameter, in useSelect and useCombobox + in Downshift where this was missing. useMultipleSelection type for itemToString stays the same as it can't receive null as item.
To migrate to the new change, update your types or code if necessary. itemToString: (item: Item) => string -> itemToString: (item: Item | null) => string}. PR with the changes: downshift-js/downshift#1075downshift-js/downshift#1105
Pass type to the onChange (onInputValueChange, onHighlightedIndexChange, onSelectedItemChange, onIsOpenChange) handler parameters, as specified in the documentation. Also updated the TS typings to reflect this + onStateChange - the type parameter was passed but it was not reflected in the TS types.
To migrate to the new change, update your types or code if necessary, better to view the changes in the PR: downshift-js/downshift#985. Important: please update to the 6.0.2 version since it contains a couple of fixes for the changes in this Breaking Change. Final changes:
stateReducer?: (
state: UseComboboxState<Item>,
actionAndChanges: UseComboboxStateChangeOptions<Item>, // UseComboboxStateChangeOptions has the correct typings
) => Partial<UseComboboxState<Item>> // this now reflects the correct return, which is the partial state.
onSelectedItemChange?: (changes: UseComboboxStateChange<Item>) => void // changes have partial state + type
onIsOpenChange?: (changes: UseComboboxStateChange<Item>) => void
onHighlightedIndexChange?: (changes: UseComboboxStateChange<Item>) => void
onStateChange?: (changes: UseComboboxStateChange<Item>) => void
onInputValueChange?: (changes: UseComboboxStateChange<Item>) => void
where
</tr></table> ... (truncated)
Commits
f4d446c fix(release): manually release a patch version (#1128)
551d790 docs: add limejoe as a contributor (#1127)
7fb1537 fix(Typescript): fix stateReducer() return type for hooks (#1126)
11d2d3f fix(Typescript): fix UseComboboxDispatchAction type (#1124)
Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.
If all status checks pass Dependabot will automatically merge this pull request during working hours.
Dependabot commands and options
You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it
- `@dependabot merge` will merge this PR after your CI passes on it
- `@dependabot squash and merge` will squash and merge this PR after your CI passes on it
- `@dependabot cancel merge` will cancel a previously requested merge and block automerging
- `@dependabot reopen` will reopen this PR if it is closed
- `@dependabot close` will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
- `@dependabot ignore this major version` will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
- `@dependabot ignore this minor version` will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
- `@dependabot ignore this dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
- `@dependabot use these labels` will set the current labels as the default for future PRs for this repo and language
- `@dependabot use these reviewers` will set the current reviewers as the default for future PRs for this repo and language
- `@dependabot use these assignees` will set the current assignees as the default for future PRs for this repo and language
- `@dependabot use this milestone` will set the current milestone as the default for future PRs for this repo and language
- `@dependabot badge me` will comment on this PR with code to add a "Dependabot enabled" badge to your readme
Additionally, you can set the following in your Dependabot [dashboard](https://app.dependabot.com):
- Update frequency (including time of day and day of week)
- Pull request limits (per update run and/or open at any time)
- Automerge options (never/patch/minor, and dev/runtime dependencies)
- Out-of-range updates (receive only lockfile updates, if desired)
- Security updates (receive only security updates, if desired)
Bumps downshift from 5.2.2 to 6.0.2.
Release notes
Sourced from downshift's releases.
Commits
f4d446c
fix(release): manually release a patch version (#1128)551d790
docs: add limejoe as a contributor (#1127)7fb1537
fix(Typescript): fix stateReducer() return type for hooks (#1126)11d2d3f
fix(Typescript): fix UseComboboxDispatchAction type (#1124)5187c48
docs: add vvo as a contributor (#1125)87abf18
docs(useCombobox): add button type "button" to docs (#1098)ddd0e6d
downshift v6 (#1104)d7bf498
fix(useSelect): ensure the initial selected item is scrolled into view on fir...490bdb7
docs: add IwalkAlone as a contributor (#1115)5353265
fix(useCombobox): fix onSelectedItemChange not triggering with controlled sel...Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting
@dependabot rebase
.If all status checks pass Dependabot will automatically merge this pull request during working hours.
Dependabot commands and options
You can trigger Dependabot actions by commenting on this PR: - `@dependabot rebase` will rebase this PR - `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it - `@dependabot merge` will merge this PR after your CI passes on it - `@dependabot squash and merge` will squash and merge this PR after your CI passes on it - `@dependabot cancel merge` will cancel a previously requested merge and block automerging - `@dependabot reopen` will reopen this PR if it is closed - `@dependabot close` will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually - `@dependabot ignore this major version` will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this minor version` will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself) - `@dependabot use these labels` will set the current labels as the default for future PRs for this repo and language - `@dependabot use these reviewers` will set the current reviewers as the default for future PRs for this repo and language - `@dependabot use these assignees` will set the current assignees as the default for future PRs for this repo and language - `@dependabot use this milestone` will set the current milestone as the default for future PRs for this repo and language - `@dependabot badge me` will comment on this PR with code to add a "Dependabot enabled" badge to your readme Additionally, you can set the following in your Dependabot [dashboard](https://app.dependabot.com): - Update frequency (including time of day and day of week) - Pull request limits (per update run and/or open at any time) - Automerge options (never/patch/minor, and dev/runtime dependencies) - Out-of-range updates (receive only lockfile updates, if desired) - Security updates (receive only security updates, if desired)