fix: disable autocomplete on search so it doesn't default to username
This commit is contained in:
parent
27036df2f3
commit
2e41d9f460
|
@ -4,14 +4,22 @@ import PropTypes from 'prop-types';
|
||||||
|
|
||||||
import classes from './search.scss';
|
import classes from './search.scss';
|
||||||
|
|
||||||
|
const noSubmit = (e) => {
|
||||||
|
e.preventDefault();
|
||||||
|
};
|
||||||
|
|
||||||
const Search = (props) => {
|
const Search = (props) => {
|
||||||
return (
|
return (
|
||||||
<input
|
<form autoComplete="off" onSubmit={noSubmit}>
|
||||||
type="text"
|
<input
|
||||||
placeholder={props.placeHolder}
|
name="search-box"
|
||||||
className={ classes.searchBox }
|
type="text"
|
||||||
onChange={ props.handleSearchInput }
|
placeholder={props.placeHolder}
|
||||||
/>
|
className={classes.searchBox}
|
||||||
|
onChange={props.handleSearchInput}
|
||||||
|
autoComplete="off"
|
||||||
|
/>
|
||||||
|
</form>
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -1,3 +1,3 @@
|
||||||
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
// 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>"`;
|
||||||
|
|
Loading…
Reference in New Issue