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

[changed] Disable native autocomplete #93

Merged
merged 1 commit into from
Jun 5, 2016
Merged
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 lib/Autocomplete.js
Original file line number Diff line number Diff line change
Expand Up @@ -322,6 +322,7 @@ let Autocomplete = React.createClass({
{...this.props.inputProps}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Later props take precedence: https://facebook.github.io/react/docs/jsx-spread.html#spread-attributes

This should come at the end of the props list so that the consumer can override autoComplete (and everything else for that matter).

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As I said in the description:

If this proves to be problematic we can change the ordering so that the consumer can override it via inputProps: { autoComplete: 'on' }.

Some props we don't want to let the user override (e.g. onFocus, onBlur), some we probably don't want them to override (e.g. role, aria-autocomplete), while others we may want to let them override (e.g. autoComplete). I don't know if there has been put any thought into this, so I just followed the existing convention of putting "our" props last.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Bah, I totally misread the original description, sorry about that. Sounds good.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Np :)

role="combobox"
aria-autocomplete="both"
autoComplete="off"
ref="input"
onFocus={this.handleInputFocus}
onBlur={this.handleInputBlur}
Expand Down