-
Notifications
You must be signed in to change notification settings - Fork 931
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
<!-- Thanks for your interest in the project. Bugs filed and PRs submitted are appreciated! Please make sure that you are familiar with and follow the Code of Conduct for this project (found in the CODE_OF_CONDUCT.md file). Also, please make sure you're familiar with and follow the instructions in the contributing guidelines (found in the CONTRIBUTING.md file). If you're new to contributing to open source projects, you might find this free video course helpful: http://kcd.im/pull-request Please fill out the information below to expedite the review and (hopefully) merge of your pull request! --> <!-- What changes are being made? (What feature/bug is being fixed here?) --> **What**: BREAKING CHANGE: Release Downshift v9. <!-- Why are these changes necessary? --> **Why**: Release the changes in: - #1580 - #1579 - #1583 Closes #1322. Closes #1244. Closes #1227 Closes #1225. <!-- How were these changes implemented? --> **How**: Merged the PRs in this branch. <!-- Have you done all of these things? --> **Checklist**: <!-- add "N/A" to the end of each line that's irrelevant to your changes --> <!-- to check an item, place an "x" in the box like so: "- [x] Documentation" --> - [x] Documentation - [x] Tests - [x] TypeScript Types - [ ] Flow Types - [x] Ready to be merged <!-- In your opinion, is this ready to be merged as soon as it's reviewed? --> <!-- feel free to add additional comments -->
- Loading branch information
1 parent
7997f76
commit 5b0d503
Showing
23 changed files
with
549 additions
and
1,017 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
module.exports = jest.fn() | ||
module.exports = {setStatus: jest.fn(), cleanupStatusDiv: jest.fn()} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,94 @@ | ||
# Migration from v8 to v9 | ||
|
||
Downshift v8 receives a list of breaking changes, which are necessary to improve | ||
both the user and the developer experience. The changes are only affecting the | ||
hooks and are detailed below. | ||
|
||
## Table of Contents | ||
|
||
<!-- START doctoc generated TOC please keep comment here to allow auto update --> | ||
<!-- DON'T EDIT THIS SECTION, INSTEAD RE-RUN doctoc TO UPDATE --> | ||
|
||
- [onChange Typescript Improvements](#onchange-typescript-improvements) | ||
- [getA11ySelectionMessage](#geta11yselectionmessage) | ||
- [getA11yRemovalMessage](#geta11yremovalmessage) | ||
- [getA11yStatusMessage](#geta11ystatusmessage) | ||
- [selectedItemChanged](#selecteditemchanged) | ||
|
||
<!-- END doctoc generated TOC please keep comment here to allow auto update --> | ||
|
||
## onChange Typescript Improvements | ||
|
||
The handlers below have their types improved to reflect that they will always | ||
get called with their corresponding state prop: | ||
|
||
- useCombobox | ||
|
||
- onSelectedItemChange: selectedItem is non optional | ||
- onIsOpenChange: isOpen is non optional | ||
- onHighlightedIndexChange: highlightedIndex is non optional | ||
|
||
- useSelect | ||
|
||
- onSelectedItemChange: selectedItem is non optional | ||
- onIsOpenChange: isOpen is non optional | ||
- onHighlightedIndexChange: highlightedIndex is non optional | ||
- onInputValueChange: inputValue is non optional | ||
|
||
- useMultipleSelection | ||
- onActiveIndexChange: activeIndex is non optional | ||
- onSelectedItemsChange: selectedItems is non optional | ||
|
||
<!-- END doctoc generated TOC please keep comment here to allow auto update --> | ||
|
||
## getA11ySelectionMessage | ||
|
||
The prop has been removed from useSelect and useCombobox. If you still need an | ||
a11y selection message, use either `getA11yStatusMessage` or your own aria-live | ||
implementation inside a `onStateChange` callback. | ||
|
||
## getA11yRemovalMessage | ||
|
||
The prop has been removed from useMultipleSelection. If you still need an a11y | ||
removal message, use either `getA11yStatusMessage` or your own aria-live | ||
implementation inside a `onStateChange` callback. | ||
|
||
## getA11yStatusMessage | ||
|
||
The prop has been also added to useMultipleSelection, but has some changes | ||
reflected in each of the hook's readme. | ||
|
||
- there is no default function provided, so you will not get any aria-live | ||
message anymore if you don't provide the prop directly to the hooks. | ||
- the function is called only with the hook's state, and you should already have | ||
access to the props, such as items or itemToString. Values such as | ||
highlightedItem or resultsCount have been removed, so you need to compute them | ||
yourself if needed. | ||
- `Downshift` is not affected, it has the same `getA11yStatusMessage` as before, | ||
no changes there at all. | ||
|
||
The HTML markup with the ARIA attributes we provide through the getter props | ||
should be enough for screen readers to report: | ||
|
||
- results count. | ||
- highlighted item. | ||
- item selection. | ||
- what actions the user can take. | ||
|
||
If you need anything more specific as part of an aria-live region, please use | ||
the new version of `getA11yStatusMessage` or your own aria-live implementation. | ||
|
||
References: | ||
|
||
- [useCombobox docs](https://github.com/downshift-js/downshift/blob/master/src/hooks/useCombobox/README.md#geta11ystatusmessage) | ||
- [useSelect docs](https://github.com/downshift-js/downshift/blob/master/src/hooks/useSelect/README.md#geta11ystatusmessage) | ||
- [useMultipleSelection docs](https://github.com/downshift-js/downshift/blob/master/src/hooks/useMultipleSelection/README.md#geta11ystatusmessage) | ||
|
||
## selectedItemChanged | ||
|
||
This prop has been removed from `useCombobox`. You should use `itemToKey` | ||
instead. | ||
|
||
Reference: | ||
|
||
[itemToKey docs](https://github.com/downshift-js/downshift/blob/master/src/hooks/useCombobox/README.md#itemtokey) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.