mirror of
https://github.com/Radarr/Radarr.git
synced 2024-09-11 20:12:41 +02:00
Fixed: Copying passwords
(cherry picked from commit c871b3f9487b9bfeb3726d763a632a772b420a0a)
This commit is contained in:
parent
0dd05b2dac
commit
a9a0d47f9f
@ -3,10 +3,17 @@ import React from 'react';
|
|||||||
import TextInput from './TextInput';
|
import TextInput from './TextInput';
|
||||||
import styles from './PasswordInput.css';
|
import styles from './PasswordInput.css';
|
||||||
|
|
||||||
|
// Prevent a user from copying (or cutting) the password from the input
|
||||||
|
function onCopy(e) {
|
||||||
|
e.preventDefault();
|
||||||
|
e.nativeEvent.stopImmediatePropagation();
|
||||||
|
}
|
||||||
|
|
||||||
function PasswordInput(props) {
|
function PasswordInput(props) {
|
||||||
return (
|
return (
|
||||||
<TextInput
|
<TextInput
|
||||||
{...props}
|
{...props}
|
||||||
|
onCopy={onCopy}
|
||||||
/>
|
/>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
@ -130,7 +130,8 @@ class TextInput extends Component {
|
|||||||
step,
|
step,
|
||||||
min,
|
min,
|
||||||
max,
|
max,
|
||||||
onBlur
|
onBlur,
|
||||||
|
onCopy
|
||||||
} = this.props;
|
} = this.props;
|
||||||
|
|
||||||
return (
|
return (
|
||||||
@ -155,6 +156,8 @@ class TextInput extends Component {
|
|||||||
onChange={this.onChange}
|
onChange={this.onChange}
|
||||||
onFocus={this.onFocus}
|
onFocus={this.onFocus}
|
||||||
onBlur={onBlur}
|
onBlur={onBlur}
|
||||||
|
onCopy={onCopy}
|
||||||
|
onCut={onCopy}
|
||||||
onKeyUp={this.onKeyUp}
|
onKeyUp={this.onKeyUp}
|
||||||
onMouseDown={this.onMouseDown}
|
onMouseDown={this.onMouseDown}
|
||||||
onMouseUp={this.onMouseUp}
|
onMouseUp={this.onMouseUp}
|
||||||
@ -180,6 +183,7 @@ TextInput.propTypes = {
|
|||||||
onChange: PropTypes.func.isRequired,
|
onChange: PropTypes.func.isRequired,
|
||||||
onFocus: PropTypes.func,
|
onFocus: PropTypes.func,
|
||||||
onBlur: PropTypes.func,
|
onBlur: PropTypes.func,
|
||||||
|
onCopy: PropTypes.func,
|
||||||
onSelectionChange: PropTypes.func
|
onSelectionChange: PropTypes.func
|
||||||
};
|
};
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user