Skip to content

Commit 07dc061

Browse files
cbergmilleragirton
authored andcommitted
[ADD] Clarified the onInputChange prop signature in the docs (JedWatson#1773)
* [ADD] Clarified the onInputChange prop signature in the docs * [ADD] requested changes
1 parent 40db517 commit 07dc061

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

README.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -303,7 +303,8 @@ The custom `menuRenderer` property accepts the following named parameters:
303303

304304
### Updating input values with onInputChange
305305

306-
You can manipulate the input using the onInputChange and returning a new value.
306+
You can manipulate the input by providing a `onInputChange` callback that returns a new value.
307+
**Please note:** When you want to use `onInputChange` only to listen to the input updates, you still have to return the unchanged value!
307308

308309
```js
309310
function cleanInput(inputValue) {
@@ -385,7 +386,7 @@ function onInputKeyDown(event) {
385386
| onClose | func | undefined | handler for when the menu closes: `function () {}` |
386387
| onCloseResetsInput | bool | true | whether to clear input when closing the menu through the arrow |
387388
| onFocus | func | undefined | onFocus handler: `function(event) {}` |
388-
| onInputChange | func | undefined | onInputChange handler: `function(inputValue) {}` |
389+
| onInputChange | func | undefined | onInputChange handler/interceptor: `function(inputValue: string): string` |
389390
| onInputKeyDown | func | undefined | input keyDown handler; call `event.preventDefault()` to override default `Select` behavior: `function(event) {}` |
390391
| onOpen | func | undefined | handler for when the menu opens: `function () {}` |
391392
| onValueClick | func | undefined | onClick handler for value labels: `function (value, event) {}` |

0 commit comments

Comments
 (0)