2.0.0 (2018-06-14)
New Features
- Improved TypeScript Definitions
- New FlowTyped Definitions
- Improved TS and Flow integration
- Documentation re-organization to make it easier to identify the most common props.
- A new prop getter called
getMenuProps
is recommended for accessibility purposes. - Simplified setting element IDs with new props:
labelId
,inputId
,menuId
, andgetItemId
which simplifies the internal implementation as well as resolving confusing accessibility issues. (These props are not required).
Bug Fixes
getButtonProps
was renamed togetToggleButtonProps
- A bunch of accessibility-related improvements and fixes
- Downshift now works much better with menus rendered within a portal (given you use the new
getMenuProps()
).
Breaking Changes
- Previously we supported
render
(<Downshift render={() => {}} />
) andchildren
(<Downshift>={() => {}}</Downshift>
). Now we only support thechildren
prop.
-<Downshift render={yourRenderFn} />
+<Downshift>{yourRenderFn}</Downshift>
- The
breakingChanges
prop has been removed and theresetInputOnSelection
option is now the default behavior. It only applies for use cases where theselectedItem
is controlled. Learn more about this in #243. - If you're using CommonJS, you'll need to change your require statement:
-const Downshift = require('downshift')
+const Downshift = require('downshift').default
- If you're using
resetIdCounter
, that's now exported separate fromDownshift
:
-import Downshift from 'downshift'
-Downshift.resetIdCounter()
+import Downshift, {resetIdCounter} from 'downshift'
+resetIdCounter()
Special thank you
All of the project contributors have been awesome. Thank you all. Here are a few specific people who helped in this release:
@kentcdodds, @stereobooster, @franklixuefei, @dovidweisz, @Antontelesh, @tansongyang, @Andarist, @cycomachead, @mperrotti, @SiTaggart, and @1Copenut