github downshift-js/downshift v5.0.0

latest releases: v9.0.8, v9.0.7, v9.0.6...
4 years ago

5.0.0 (2020-02-10)

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

Don't miss a new downshift release

NewReleases is sending notifications on new releases.