Skip to content

Commit

Permalink
Merge pull request #537 from auth0/email-input-fix
Browse files Browse the repository at this point in the history
Fix email input in IE 10
  • Loading branch information
gnandretta authored Aug 5, 2016
2 parents ab9bb97 + c7b45fe commit b092f4f
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 3 deletions.
10 changes: 9 additions & 1 deletion src/ui/input/email_input.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,14 @@ export default class EmailInput extends React.Component {
this.state = {};
}

shouldComponentUpdate(nextProps) {
const { invalidHint, isValid, value, onChange } = this.props;

return invalidHint != nextProps.invalidHint
|| isValid != nextProps.isValid
|| value != nextProps.value;
}

render() {
const { invalidHint, isValid, onChange, ...props } = this.props;
const { focused } = this.state;
Expand All @@ -29,7 +37,7 @@ export default class EmailInput extends React.Component {
placeholder="[email protected]"
autoComplete="off"
autoCapitalize="off"
onInput={::this.handleOnChange}
onChange={::this.handleOnChange}
onFocus={::this.handleFocus}
onBlur={::this.handleBlur}
{...props}/>
Expand Down
8 changes: 8 additions & 0 deletions src/ui/input/username_input.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,14 @@ export default class UsernameInput extends React.Component {
this.state = {};
}

shouldComponentUpdate(nextProps) {
const { invalidHint, isValid, value, onChange } = this.props;

return invalidHint != nextProps.invalidHint
|| isValid != nextProps.isValid
|| value != nextProps.value;
}

render() {
const { invalidHint, isValid, onChange, ...props } = this.props;
const { focused } = this.state;
Expand Down
3 changes: 1 addition & 2 deletions test/helper/ui.js
Original file line number Diff line number Diff line change
Expand Up @@ -157,8 +157,7 @@ const check = (lock, query) => {
const checkFn = query => lock => check(lock, query);
export const clickTermsCheckbox = checkFn(".auth0-lock-sign-up-terms-agreement label input[type='checkbox']");
const fillInput = (lock, name, str) => {
var method = name === "email" ? "input" : "change";
Simulate[method](qInput(lock, name, true), {target: {value: str}});
Simulate.change(qInput(lock, name, true), {target: {value: str}});
};
const fillInputFn = name => (lock, str) => fillInput(lock, name, str);

Expand Down

0 comments on commit b092f4f

Please sign in to comment.