Remove password reveal feature from IE and Edge using ::-ms-reveal pseudo selector
This commit is contained in:
		| @@ -1,11 +1,21 @@ | |||||||
| import React from 'react'; | import React from 'react'; | ||||||
| import { TextValidator } from 'react-material-ui-form-validator'; | import { TextValidator } from 'react-material-ui-form-validator'; | ||||||
|  | import { withStyles } from '@material-ui/core/styles'; | ||||||
| import { InputAdornment } from '@material-ui/core'; | import { InputAdornment } from '@material-ui/core'; | ||||||
| import Visibility from '@material-ui/icons/Visibility'; | import Visibility from '@material-ui/icons/Visibility'; | ||||||
| import VisibilityOff from '@material-ui/icons/VisibilityOff'; | import VisibilityOff from '@material-ui/icons/VisibilityOff'; | ||||||
| import IconButton from '@material-ui/core/IconButton'; | import IconButton from '@material-ui/core/IconButton'; | ||||||
|  |  | ||||||
| export default class PasswordValidator extends React.Component { | const styles = theme => ( | ||||||
|  |   { | ||||||
|  |     input: { | ||||||
|  |       "&::-ms-reveal": { | ||||||
|  |         display: "none" | ||||||
|  |       } | ||||||
|  |     } | ||||||
|  |   }); | ||||||
|  |  | ||||||
|  | class PasswordValidator extends React.Component { | ||||||
|  |  | ||||||
|   state = { |   state = { | ||||||
|     showPassword: false |     showPassword: false | ||||||
| @@ -18,11 +28,13 @@ export default class PasswordValidator extends React.Component { | |||||||
|   } |   } | ||||||
|  |  | ||||||
|   render() { |   render() { | ||||||
|  |     const { classes, ...rest } = this.props; | ||||||
|     return ( |     return ( | ||||||
|       <TextValidator |       <TextValidator | ||||||
|         {...this.props} |         {...rest} | ||||||
|         type={this.state.showPassword ? 'text' : 'password'} |         type={this.state.showPassword ? 'text' : 'password'} | ||||||
|         InputProps={{ |         InputProps={{ | ||||||
|  |           classes, | ||||||
|           endAdornment: |           endAdornment: | ||||||
|             <InputAdornment position="end"> |             <InputAdornment position="end"> | ||||||
|               <IconButton |               <IconButton | ||||||
| @@ -38,3 +50,5 @@ export default class PasswordValidator extends React.Component { | |||||||
|   } |   } | ||||||
|  |  | ||||||
| } | } | ||||||
|  |  | ||||||
|  | export default withStyles(styles)(PasswordValidator); | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user