fix: disable autocomplete on search so it doesn't default to username

This commit is contained in:
jharris4 2018-05-06 10:40:44 -04:00
parent 27036df2f3
commit 2e41d9f460
2 changed files with 15 additions and 7 deletions

View File

@ -4,14 +4,22 @@ import PropTypes from 'prop-types';
import classes from './search.scss';
const noSubmit = (e) => {
e.preventDefault();
};
const Search = (props) => {
return (
<form autoComplete="off" onSubmit={noSubmit}>
<input
name="search-box"
type="text"
placeholder={props.placeHolder}
className={ classes.searchBox }
onChange={ props.handleSearchInput }
className={classes.searchBox}
onChange={props.handleSearchInput}
autoComplete="off"
/>
</form>
);
};

View File

@ -1,3 +1,3 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP
exports[`<Search /> component should match the snapshot 1`] = `"<input type=\\"text\\" placeholder=\\"Type to search...\\" class=\\"searchBox\\"/>"`;
exports[`<Search /> component should match the snapshot 1`] = `"<form autoComplete=\\"off\\"><input type=\\"text\\" name=\\"search-box\\" placeholder=\\"Type to search...\\" class=\\"searchBox\\" autoComplete=\\"off\\"/></form>"`;