From 07dc061f7fb2c6eb8db120f5315f57352cb867f2 Mon Sep 17 00:00:00 2001 From: cbergmiller Date: Tue, 6 Jun 2017 07:04:20 +0200 Subject: [PATCH] [ADD] Clarified the onInputChange prop signature in the docs (#1773) * [ADD] Clarified the onInputChange prop signature in the docs * [ADD] requested changes --- README.md | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 4ab43b05ae..f6b3f9e660 100644 --- a/README.md +++ b/README.md @@ -303,7 +303,8 @@ The custom `menuRenderer` property accepts the following named parameters: ### Updating input values with onInputChange -You can manipulate the input using the onInputChange and returning a new value. +You can manipulate the input by providing a `onInputChange` callback that returns a new value. +**Please note:** When you want to use `onInputChange` only to listen to the input updates, you still have to return the unchanged value! ```js function cleanInput(inputValue) { @@ -385,7 +386,7 @@ function onInputKeyDown(event) { | onClose | func | undefined | handler for when the menu closes: `function () {}` | | onCloseResetsInput | bool | true | whether to clear input when closing the menu through the arrow | | onFocus | func | undefined | onFocus handler: `function(event) {}` | -| onInputChange | func | undefined | onInputChange handler: `function(inputValue) {}` | +| onInputChange | func | undefined | onInputChange handler/interceptor: `function(inputValue: string): string` | | onInputKeyDown | func | undefined | input keyDown handler; call `event.preventDefault()` to override default `Select` behavior: `function(event) {}` | | onOpen | func | undefined | handler for when the menu opens: `function () {}` | | onValueClick | func | undefined | onClick handler for value labels: `function (value, event) {}` |