Skip to content

Commit

Permalink
Web.Components: EmailInput: changed input type to 'text'. Reason: uns…
Browse files Browse the repository at this point in the history
…table working with type 'email'.

Bugs in react:
facebook/react#14168
facebook/react#6368
  • Loading branch information
Daniil Senkiv committed Oct 31, 2019
1 parent c94a3a0 commit 9928067
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions web/ASC.Web.Components/src/components/email-input/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import PropTypes from 'prop-types'
import isEqual from "lodash/isEqual";
import TextInput from '../text-input'
import { EmailSettings, parseAddress, checkAndConvertEmailSettings, isEqualEmailSettings } from '../../utils/email/';
import punycode from 'punycode';

const borderColor = {
default: '#D0D5DA',
Expand Down Expand Up @@ -79,9 +78,7 @@ class EmailInput extends React.Component {
onChangeAction = (e) => {
this.props.onChange && this.props.onChange(e);

// Google Chrome doesn't support IDN for TLDs and is converting them to Punycode. There is variable 'inputValue' against Chrome`s converting
const inputValue = punycode.toUnicode(e.target.value);
this.props.customValidateFunc ? this.props.customValidateFunc(e) : this.checkEmail(inputValue);
this.props.customValidateFunc ? this.props.customValidateFunc(e) : this.checkEmail(e.target.value);
}

shouldComponentUpdate(nextProps, nextState) {
Expand All @@ -100,7 +97,7 @@ class EmailInput extends React.Component {
isValidEmail={isValid || isValidEmail}
value={inputValue}
onChange={this.onChangeAction}
type='email'
type='text'
onValidateInput={onValidateInput}
{...rest}
/>
Expand Down

0 comments on commit 9928067

Please sign in to comment.