Skip to content
This repository was archived by the owner on Jul 19, 2019. It is now read-only.

Commit 3078b06

Browse files
author
Mouse Braun
committed
Merge branch 'master' of github.com:jordanlapointe/react-autocomplete
2 parents 41388f7 + 2daeece commit 3078b06

File tree

2 files changed

+6
-5
lines changed

2 files changed

+6
-5
lines changed

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ Props passed to `props.renderInput`. By default these props will be
7575
applied to the `<input />` element rendered by `Autocomplete`, unless you
7676
have specified a custom value for `props.renderInput`. Any properties
7777
supported by `HTMLInputElement` can be specified, apart from the
78-
following which are set by `Autocomplete`: value, autoComplete, role,
78+
following which are set by `Autocomplete`: value, role,
7979
aria-autocomplete. `inputProps` is commonly used for (but not limited to)
8080
placeholder, event handlers (onFocus, onBlur, etc.), autoFocus, etc..
8181

lib/Autocomplete.js

+5-4
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ class Autocomplete extends React.Component {
116116
* applied to the `<input />` element rendered by `Autocomplete`, unless you
117117
* have specified a custom value for `props.renderInput`. Any properties
118118
* supported by `HTMLInputElement` can be specified, apart from the
119-
* following which are set by `Autocomplete`: value, autoComplete, role,
119+
* following which are set by `Autocomplete`: value, role,
120120
* aria-autocomplete. `inputProps` is commonly used for (but not limited to)
121121
* placeholder, event handlers (onFocus, onBlur, etc.), autoFocus, etc..
122122
*/
@@ -577,12 +577,13 @@ class Autocomplete extends React.Component {
577577
role: 'combobox',
578578
'aria-autocomplete': 'list',
579579
'aria-expanded': open,
580-
autoComplete: 'off',
580+
autoComplete: inputProps.autoComplete || 'new-password'
581581
ref: this.exposeAPI,
582-
onFocus: this.handleInputFocus,
583-
onBlur: this.handleInputBlur,
582+
onFocus: this.composeEventHandlers(this.handleInputFocus, inputProps.onFocus),
583+
onBlur: this.composeEventHandlers(this.handleInputBlur, inputProps.onBlur),
584584
onChange: this.handleChange,
585585
onKeyDown: this.composeEventHandlers(this.handleKeyDown, inputProps.onKeyDown),
586+
onKeyUp: this.composeEventHandlers(this.handleKeyUp, inputProps.onKeyUp),
586587
onClick: this.composeEventHandlers(this.handleInputClick, inputProps.onClick),
587588
value: this.props.value,
588589
})}

0 commit comments

Comments
 (0)