Skip to content

Commit 5f529ec

Browse files
committed
Remove password reveal feature from IE and Edge using ::-ms-reveal pseudo selector
1 parent 49bf6fc commit 5f529ec

File tree

1 file changed

+16
-2
lines changed

1 file changed

+16
-2
lines changed

interface/src/components/PasswordValidator.js

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,21 @@
11
import React from 'react';
22
import { TextValidator } from 'react-material-ui-form-validator';
3+
import { withStyles } from '@material-ui/core/styles';
34
import { InputAdornment } from '@material-ui/core';
45
import Visibility from '@material-ui/icons/Visibility';
56
import VisibilityOff from '@material-ui/icons/VisibilityOff';
67
import IconButton from '@material-ui/core/IconButton';
78

8-
export default class PasswordValidator extends React.Component {
9+
const styles = theme => (
10+
{
11+
input: {
12+
"&::-ms-reveal": {
13+
display: "none"
14+
}
15+
}
16+
});
17+
18+
class PasswordValidator extends React.Component {
919

1020
state = {
1121
showPassword: false
@@ -18,11 +28,13 @@ export default class PasswordValidator extends React.Component {
1828
}
1929

2030
render() {
31+
const { classes, ...rest } = this.props;
2132
return (
2233
<TextValidator
23-
{...this.props}
34+
{...rest}
2435
type={this.state.showPassword ? 'text' : 'password'}
2536
InputProps={{
37+
classes,
2638
endAdornment:
2739
<InputAdornment position="end">
2840
<IconButton
@@ -38,3 +50,5 @@ export default class PasswordValidator extends React.Component {
3850
}
3951

4052
}
53+
54+
export default withStyles(styles)(PasswordValidator);

0 commit comments

Comments
 (0)