Skip to content

Update dependency downshift to v6

Administrator requested to merge renovate/downshift-6.x into main

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 code search for "downshift"

Release Notes

downshift-js/downshift

v6.0.6

Compare Source

Bug Fixes
  • useCombobox: select item on blur only when menu is open (#​1170) (d1299c4)

v6.0.5

Compare Source

Performance Improvements

v6.0.4

Compare Source

Bug Fixes

v6.0.3

Compare Source

Bug Fixes

v6.0.2

Compare Source

Bug Fixes

v6.0.1

Compare Source

Bug Fixes

v6.0.0

Compare Source

BREAKING CHANGES
  • 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: #​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: #​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 - 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: #​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

Compare Source

Bug Fixes
  • useSelect: ensure the initial selected item is scrolled into view on first open (#​1113) (d7bf498)

v5.4.6

Compare Source

Bug Fixes
  • useCombobox: fix onSelectedItemChange not triggering with controlled selectedItem in React.StrictMode (#​1107) (5353265)

v5.4.5

Compare Source

Bug Fixes

v5.4.4

Compare Source

Bug Fixes
  • useCombobox: navigating up if all items are disabled (#​1087) (a71005b)

v5.4.3

Compare Source

Bug Fixes

v5.4.2

Compare Source

Bug Fixes
  • useCombobox: update inputValue when calling selectItem (#​1055) (52aad04)

v5.4.1

Compare Source

Bug Fixes

v5.4.0

Compare Source

Features

v5.3.0

Compare Source

Features

v5.2.7

Compare Source

Bug Fixes

v5.2.6

Compare Source

Bug Fixes

v5.2.5

Compare Source

Performance Improvements

v5.2.4

Compare Source

Bug Fixes

v5.2.3

Compare Source

Bug Fixes

v5.2.2

Compare Source

Bug Fixes
  • useSelect: don't trigger blur state change after item selection (#​1016) (dff18c0)

v5.2.1

Compare Source

Bug Fixes

v5.2.0

Compare Source

Features
  • hooks: align behavior of a11y status messages between hooks and Downshift (#​1004) (5525e98)

v5.1.1

Compare Source

Bug Fixes
  • useMultipleSelection: replace item with selectedItem in typings for getSelectedItemProps (#​1002) (5ad8864)

v5.1.0

Compare Source

Features

v5.0.7

Compare Source

Bug Fixes

v5.0.6

Compare Source

Bug Fixes
  • typescript: add missing scrollIntoView definitions to hooks (#​983) (75b2fb6)

v5.0.5

Compare Source

Bug Fixes
  • hooks: replace Object.entries with Object.keys to support > IE 9 (#​971) (536bebc)

v5.0.4

Compare Source

Bug Fixes
  • hooks: call onStateChange with type and only changed props (#​967) (f6a7913)

v5.0.3

Compare Source

Bug Fixes
  • hooks: only add aria-activedescendant when menu is open (#​945) (28cdc02)

v5.0.2

Compare Source

Bug Fixes

v5.0.1

Compare Source

Bug Fixes
  • useCombobox: dispatch ToggleButtonClick before focusing input (#​942) (26d426e)

v5.0.0

Compare Source

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 renaming keysSoFar with inputValue.

To migrate to the new change, simply check for FunctionSetInputValue with empty string as inputValue instead of checking for FunctionClearKeysSoFar in stateReducer.

  • Both getA11yStatusMessage and getA11ySelectionMessage will be called with the same props as the getA11yStatusMessage in <Downshift>, apart from previousResultCount. 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

Compare Source

Features
  • hooks: add aria-selected="false" to each non-highlighted item (#​929) (860da10)

v4.0.11

Compare Source

Bug Fixes

v4.0.10

Compare Source

Bug Fixes
  • useSelect: dispatch closure issue on search by key (#​923) (653dbfd)

v4.0.9

Compare Source

Bug Fixes

v4.0.8

Compare Source

Bug Fixes
  • useEnhancedReducer: call onChange callbacks outside the reducer (#​912) (221d50d)

v4.0.7

Compare Source

Bug Fixes

v4.0.6

Compare Source

Bug Fixes
  • useSelect: correct typings for toggleButton and menu getter props (#​896) (37f41ce)

v4.0.5

Compare Source

Bug Fixes
  • useCombobox: use mouse and touch events to trigger blur (#​893) (6b7a79b)

v4.0.4

Compare Source

Bug Fixes
  • useCombobox: pass down missing disabled prop in prop getters (#​882) (02c5c66)

v4.0.3

Compare Source

Bug Fixes

v4.0.2

Compare Source

Bug Fixes

v4.0.1

Compare Source

Bug Fixes
  • highlightedIndex: do not highlight disabled items by keyboard (#​799) (84b6ff6)

v4.0.0

Compare Source

Bug Fixes
Features
BREAKING CHANGES
  • release: TypeScript typings have changed for both useSelect and Downshift. See PR for details.

Renovate configuration

📅 Schedule: "on the 1st through 7th day of the month" in timezone America/Los_Angeles.

🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.

Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.

🔕 Ignore: Close this PR and you won't be reminded about this update again.


  • If you want to rebase/retry this PR, check this box

This PR has been generated by WhiteSource Renovate. View repository job log here.

Merge request reports

Loading