Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,7 @@ const items = [
<AutoComplete
label={'I will complete you'}
items={items}
autoComplete="off"
valueIndex={'id'}
dataIndex={'name'}
/>
Expand Down
4 changes: 3 additions & 1 deletion src/AutoComplete/AutoComplete.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ export default class AutoComplete extends Component {

static propTypes = {
align: PropTypes.string,
autoComplete: PropTypes.string,
className: PropTypes.string,
dataIndex: PropTypes.string.isRequired,
disabled: PropTypes.bool,
Expand Down Expand Up @@ -76,7 +77,7 @@ export default class AutoComplete extends Component {

render() {
const {
align, className, dataIndex, disabled, error, floatingLabel,
align, autoComplete, className, dataIndex, disabled, error, floatingLabel,
items, label, offset, readOnly, value, valueIndex,
} = this.props
const { focused, value: stateValue } = this.state
Expand Down Expand Up @@ -111,6 +112,7 @@ export default class AutoComplete extends Component {
floatingLabel,
label,
readOnly: disabled,
autoComplete,
ref: ref => this.input = ref,
type: 'text',
onChange: this.onTextfieldChange,
Expand Down
19 changes: 19 additions & 0 deletions stories/AutoComplete.story.js
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,25 @@ storiesOf('AutoComplete', module)
disabled
/>
))
.add('autocomplete off', () => (
<div>
<span>Turn off browser autofill</span>
<StatefulAutoComplete
label={'First Name'}
items={items1}
valueIndex={'id'}
dataIndex={'name'}
autoComplete="off"
/>
<span>Browser default behaviour</span>
<StatefulAutoComplete
label={'Last Name'}
items={items1}
valueIndex={'id'}
dataIndex={'name'}
/>
</div>
))
.add('lots of values', () => (
<StatefulAutoComplete
label={'I will complete you'}
Expand Down