Update dependency downshift to v6
Created by: renovate[bot]
This PR contains the following updates:
Package | Type | Update | New value | References | Sourcegraph |
---|---|---|---|---|---|
downshift (source) | dependencies | major | ^6.0.6 | homepage, source |
Release Notes
downshift-js/downshift
v6.0.6
Bug Fixes
v6.0.5
Performance Improvements
v6.0.4
Bug Fixes
v6.0.3
Bug Fixes
- release: manually release a patch version (#1141) (35ff654)
- release: manually release a patch version (#1142) (4ce10e7)
v6.0.2
Bug Fixes
- release: manually release a patch version (#1128) (f4d446c)
- Typescript: fix stateReducer() return type for hooks (#1126) (7fb1537)
v6.0.1
Bug Fixes
v6.0.0
BREAKING CHANGES
- Update TS typings for
selectedItem
to acceptnull
in bothuseSelect
anduseCombobox
.
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: #1090
- Update TS typings for
itemToString
to acceptnull
for theitem
parameter, inuseSelect
anduseCombobox
+ inDownshift
where this was missing.useMultipleSelection
type foritemToString
stays the same as it can't receivenull
asitem
.
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: #1075 #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
- thetype
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: #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
export interface UseComboboxStateChangeOptions<Item>
extends UseComboboxDispatchAction<Item> { // type and optional parameters needed to compute the next state
changes: Partial<UseComboboxState<Item>> // partial state changes proposed by the hook
}
export interface UseComboboxDispatchAction<Item> {
type: UseComboboxStateChangeTypes
shiftKey?: boolean
getItemNodeFromIndex?: (index: number) => HTMLElement
inputValue?: string
index?: number
highlightedIndex?: number
selectedItem?: Item | null
selectItem?: boolean
}
export interface UseComboboxStateChange<Item>
extends Partial<UseComboboxState<Item>> {
type: UseComboboxStateChangeTypes
}
BREAKING BEHAVIOURS
-
[useCombobox]: When an item is highlighted by keyboard and user closes the menu using mouse/touch, the item is not selected anymore. The only selection on Blur happens using either Tab / Shift+Tab. PR with the changes: #1109
-
[useCombobox & downshift]: When pressing Escape and the menu is open, only close the menu. When the menu is closed and there is an item selected and/or text in the input, clear the selectedItem and the inputValue. PR with the changes: #719
v5.4.7
Bug Fixes
v5.4.6
Bug Fixes
- useCombobox: fix onSelectedItemChange not triggering with controlled selectedItem in React.StrictMode (#1107) (5353265)
v5.4.5
Bug Fixes
v5.4.4
Bug Fixes
v5.4.3
Bug Fixes
v5.4.2
Bug Fixes
v5.4.1
Bug Fixes
- scrollIntoView: do not scroll falsy node (#1047) (1873efa), closes /github.com/downshift-js/downshift/pull/1045#issuecomment-628682162
v5.4.0
Features
v5.3.0
Features
v5.2.7
Bug Fixes
v5.2.6
Bug Fixes
v5.2.5
Performance Improvements
v5.2.4
Bug Fixes
v5.2.3
Bug Fixes
v5.2.2
Bug Fixes
v5.2.1
Bug Fixes
v5.2.0
Features
v5.1.1
Bug Fixes
-
useMultipleSelection: replace item with selectedItem in typings for
getSelectedItemProps
(#1002) (5ad8864)
v5.1.0
Features
v5.0.7
Bug Fixes
v5.0.6
Bug Fixes
v5.0.5
Bug Fixes
v5.0.4
Bug Fixes
v5.0.3
Bug Fixes
v5.0.2
Bug Fixes
v5.0.1
Bug Fixes
v5.0.0
BREAKING CHANGES
- Removed
FunctionClearKeysSoFar
from state change types and TS typings. In useSelect, once the timeout for keeping the character keys in memory has expired,FunctionSetInputValue
will be used. We are doing this as we are renamingkeysSoFar
withinputValue
.
To migrate to the new change, simply check for FunctionSetInputValue
with empty string as inputValue
instead of checking for FunctionClearKeysSoFar
in stateReducer
.
- Both
getA11yStatusMessage
andgetA11ySelectionMessage
will be called with the same props as thegetA11yStatusMessage
in<Downshift>
, apart frompreviousResultCount
. In the TS typings it's now marked as optional, and all functions have the same interface definition,A11yStatusMessageOptions
.
To migrate to the new changes, in useSelect
and useCombobox
, if you used items
as parameters in any of the a11y message functions, now you should use resultCount
as probably you only needed items.length
from it anyway.
Also typings UseSelectA11yMessageOptions
and UseComboboxA11yMessageOptions
have been removed. Use A11yStatusMessageOptions
instead.
Code Changes: tests have been enhanced by using user input
from RTL
and they now look better and cleaner. Also covered more use cases better. Code has been refactored as well, and bundle size slightly reduced.
Functional Improvement: better focus management for both useSelect
and useCombobox
.
Fixes #832. Closes #892 Closes #891 Closes #873
v4.1.0
Features
v4.0.11
Bug Fixes
v4.0.10
Bug Fixes
v4.0.9
Bug Fixes
v4.0.8
Bug Fixes
v4.0.7
Bug Fixes
v4.0.6
Bug Fixes
v4.0.5
Bug Fixes
v4.0.4
Bug Fixes
v4.0.3
Bug Fixes
- release: manually release a patch version #887 (4fab769)
- typings: useCombobox prop getters' options (#876) (176fef8)
v4.0.2
Bug Fixes
v4.0.1
Bug Fixes
v4.0.0
Bug Fixes
Features
- release 4.0.0 (#812) (#857) (1a11745), closes #748
- release 4.0.0 (#860) (bb699ea), closes #812 #748
BREAKING CHANGES
-
release: TypeScript typings have changed for both
useSelect
andDownshift
. See PR for details.
Renovate configuration
-
If you want to rebase/retry this PR, check this box
This PR has been generated by WhiteSource Renovate. View repository job log here.