From 2daeecef69a35dc02f1830ddd5a7c9c4fae79f46 Mon Sep 17 00:00:00 2001 From: Jordan LaPointe Date: Tue, 28 Mar 2017 12:20:29 -0500 Subject: [PATCH] Allow setting HTML autocomplete attribute --- README.md | 2 +- lib/Autocomplete.js | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index fe1c41c0..9ca15e2b 100644 --- a/README.md +++ b/README.md @@ -53,7 +53,7 @@ Default value: `{}` Props that are applied to the `` element rendered by `Autocomplete`. Any properties supported by `HTMLInputElement` can be specified, apart from the following which are set by `Autocomplete`: -value, autoComplete, role, aria-autocomplete +value, role, aria-autocomplete ### `menuStyle: Object` (optional) Default value: diff --git a/lib/Autocomplete.js b/lib/Autocomplete.js index 7c1b395f..946f1503 100644 --- a/lib/Autocomplete.js +++ b/lib/Autocomplete.js @@ -76,7 +76,7 @@ let Autocomplete = React.createClass({ * Props that are applied to the `` element rendered by * `Autocomplete`. Any properties supported by `HTMLInputElement` can be * specified, apart from the following which are set by `Autocomplete`: - * value, autoComplete, role, aria-autocomplete + * value, role, aria-autocomplete */ inputProps: PropTypes.object, /** @@ -439,7 +439,7 @@ let Autocomplete = React.createClass({ role="combobox" aria-autocomplete="list" aria-expanded={open} - autoComplete="off" + autoComplete={inputProps.autoComplete || 'off'} ref="input" onFocus={this.composeEventHandlers(this.handleInputFocus, inputProps.onFocus)} onBlur={this.composeEventHandlers(this.handleInputBlur, inputProps.onBlur)}