Skip to content

Commit

Permalink
fix(SearchBox): autocomplete was not disabled by default (#1742)
Browse files Browse the repository at this point in the history
  • Loading branch information
mthuret authored and bobylito committed Dec 13, 2016
1 parent fdc186e commit bc76618
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 12 deletions.
13 changes: 7 additions & 6 deletions packages/react-instantsearch/src/components/SearchBox.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,12 @@ const cx = classNames('SearchBox');

/* eslint-disable max-len */
const ResetIcon = () =>
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 26 26">
<g fill="none" fillRule="evenodd">
<path d="M12.99883 9.92647L22.22236.70294c.85882-.85647 2.2306-.84706 3.08235 0 .8518.85412.8471 2.22588 0 3.0753l-9.2329 9.22353 9.22353 9.22353c.85648.85882.84707 2.23058 0 3.08235-.8541.85176-2.22587.84706-3.0753 0l-9.22116-9.23294-9.22353 9.22357c-.85646.85647-2.22823.84706-3.07764 0-.85413-.85412-.84707-2.2259 0-3.0753l9.22823-9.22117L.70235 3.77823C-.1541 2.92177-.1541 1.55.69295.69588c.85647-.85176 2.22823-.84706 3.07764 0l9.2282 9.2353v-.0047z"/>
</g>
</svg>;
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 26 26">
<g fill="none" fillRule="evenodd">
<path
d="M12.99883 9.92647L22.22236.70294c.85882-.85647 2.2306-.84706 3.08235 0 .8518.85412.8471 2.22588 0 3.0753l-9.2329 9.22353 9.22353 9.22353c.85648.85882.84707 2.23058 0 3.08235-.8541.85176-2.22587.84706-3.0753 0l-9.22116-9.23294-9.22353 9.22357c-.85646.85647-2.22823.84706-3.07764 0-.85413-.85412-.84707-2.2259 0-3.0753l9.22823-9.22117L.70235 3.77823C-.1541 2.92177-.1541 1.55.69295.69588c.85647-.85176 2.22823-.84706 3.07764 0l9.2282 9.2353v-.0047z"/>
</g>
</svg>;
/* eslint-enable max-len */

class SearchBox extends Component {
Expand Down Expand Up @@ -168,7 +169,7 @@ class SearchBox extends Component {
type="search"
placeholder={translate('placeholder')}
autoFocus={autoFocus}
autoComplete={false}
autoComplete="off"
required
value={query}
onChange={this.onChange}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ exports[`SearchBox applies its default props 1`] = `
className="ais-SearchBox__wrapper"
role="search">
<input
autoComplete={false}
autoComplete="off"
autoFocus={false}
className="ais-SearchBox__input"
onChange={[Function]}
Expand Down Expand Up @@ -45,7 +45,7 @@ exports[`SearchBox lets you customize its theme 1`] = `
className="ais-SearchBox__wrapper"
role="search">
<input
autoComplete={false}
autoComplete="off"
autoFocus={false}
className="ais-SearchBox__input"
onChange={[Function]}
Expand Down Expand Up @@ -82,7 +82,7 @@ exports[`SearchBox lets you customize its translations 1`] = `
className="ais-SearchBox__wrapper"
role="search">
<input
autoComplete={false}
autoComplete="off"
autoFocus={false}
className="ais-SearchBox__input"
onChange={[Function]}
Expand Down Expand Up @@ -120,7 +120,7 @@ exports[`SearchBox transfers the autoFocus prop to the underlying input element
className="ais-SearchBox__wrapper"
role="search">
<input
autoComplete={false}
autoComplete="off"
autoFocus={true}
className="ais-SearchBox__input"
onChange={[Function]}
Expand Down Expand Up @@ -157,7 +157,7 @@ exports[`SearchBox treats its query prop as its input value 1`] = `
className="ais-SearchBox__wrapper"
role="search">
<input
autoComplete={false}
autoComplete="off"
autoFocus={false}
className="ais-SearchBox__input"
onChange={[Function]}
Expand Down Expand Up @@ -194,7 +194,7 @@ exports[`SearchBox treats its query prop as its input value 2`] = `
className="ais-SearchBox__wrapper"
role="search">
<input
autoComplete={false}
autoComplete="off"
autoFocus={false}
className="ais-SearchBox__input"
onChange={[Function]}
Expand Down

0 comments on commit bc76618

Please sign in to comment.