diff --git a/HISTORY.md b/HISTORY.md index 9878d3d51d..708369a5f5 100644 --- a/HISTORY.md +++ b/HISTORY.md @@ -1,8 +1,32 @@ # React-Select +## v1.0.0-beta13 / 2016-05-30 + +* added; `inputRenderer` prop, allows you to override the input component, thanks [Sean Burke](https://github.com/leftmostcat) +* added; `openOnFocus` prop, causes the menu to always open when the select control is focused, thanks [HuysentruytRuben](https://github.com/HuysentruytRuben) +* added; `react-virtualised-select` HOC example, thanks [Brian Vaughn](https://github.com/bvaughn) +* added; `tabSelectsValue` prop can be set to false to prevent selection of focused option when tab is pressed, thanks [Byron Anderson](https://github.com/byronanderson) +* added; ability to override `resetValue` when clearing the control, thanks [Alexander Luberg](https://github.com/LubergAlexander) +* added; input can be updated with `onInputChange`, thanks [Brett DeWoody](https://github.com/brettdewoody) +* added; Styles for .is-selected class, thanks [Danny Herran](https://github.com/dherran) +* fixed; `noResultsText` prop type is now `stringOrNode` for Async component, thanks [Michael Groeneman](https://github.com/mgroeneman) +* fixed; `onInputChange` is wrapped by Async component, thanks [Eric O'Connell](https://github.com/drd) +* fixed; `scrollMenuIntoView` behaviour in IE10, thanks [Ivan Jager](https://github.com/aij) +* fixed; isEqualNode replaced with strict equality check, thanks [Alexandre Balhier](https://github.com/abalhier) +* fixed; issue with value object not being passed to `handleRequired`, thanks [Andrew Hite](https://github.com/andyhite) +* fixed; the menu-outer container is no longer rendered when it does not contain anything, thanks [Kuan](https://github.com/khankuan) +* improved; better support for IE8 in styles, thanks [Rockallite Wulf](https://github.com/rockallite) + +## v1.0.0-beta12 / 2016-04-02 + +* added; `menuRenderer` method and example for effeciently rendering thousands of options, thanks [Brian Vaughn](https://github.com/bvaughn) +* added; `optionClassName` prop, thanks [Max Tyler](https://github.com/iam4x) + ## v1.0.0-beta11 / 2016-03-09 * updated dependencies to allow use with React 15.x +* changed; multiple selected values are now submitted using multiple inputs, thanks [Trinh Hoang Nhu](https://github.com/james4388) +* added; `joinValues` prop to revert the above change and submit multiple values in a single field with the delimiter ## v1.0.0-beta10 / 2016-02-23 diff --git a/README.md b/README.md index c429b28469..37b5b81a7f 100644 --- a/README.md +++ b/README.md @@ -85,8 +85,9 @@ function logChange(val) { You can enable multi-value selection by setting `multi={true}`. In this mode: * Selected options will be removed from the dropdown menu -* The values of the selected items are joined using the `delimiter` property to create the input value -* A simple value, if provided, will be split using the `delimiter` property +* The selected values are submitted in multiple `` fields, use `joinValues` to submit joined values in a single field instead +* The values of the selected items are joined using the `delimiter` prop to create the input value when `joinValues` is true +* A simple value, if provided, will be split using the `delimiter` prop * The `onChange` event provides an array of the selected options as the second argument * The first argument to `onChange` is always a string, regardless of whether the values of the selected options are numbers or strings * By default, only options in the `options` array can be selected. Setting `allowCreate` to true allows new options to be created if they do not already exist. @@ -251,22 +252,39 @@ menuRenderer({ focusedOption, focusOption, labelKey, options, selectValue, value Check out the demo site for a more complete example of this. +### Updating input values with onInputChange + +You can manipulate the input using the onInputChange and returning a new value. + +```js +function cleanInput(inputValue) { + // Strip all non-number characters from the input + return inputValue.replace(/[^0-9]/g, ""); +} + + tag with this field name for html forms @@ -374,16 +386,21 @@ var Select = _react2['default'].createClass({ onMenuScrollToBottom: _react2['default'].PropTypes.func, // fires when the menu is scrolled to the bottom; can be used to paginate options onOpen: _react2['default'].PropTypes.func, // fires when the menu is opened onValueClick: _react2['default'].PropTypes.func, // onClick handler for value labels: function (value, event) {} + openAfterFocus: _react2['default'].PropTypes.bool, // boolean to enable opening dropdown when focused + openOnFocus: _react2['default'].PropTypes.bool, // always open options menu on focus + optionClassName: _react2['default'].PropTypes.string, // additional class(es) to apply to the