mirror of
https://github.com/scm-manager/scm-manager.git
synced 2025-11-10 15:35:49 +01:00
improve authentication
This commit is contained in:
@@ -6,6 +6,7 @@ type Props = {
|
||||
label?: string,
|
||||
placeholder?: string,
|
||||
type?: string,
|
||||
autofocus?: boolean,
|
||||
onChange: string => void
|
||||
};
|
||||
|
||||
@@ -15,6 +16,14 @@ class InputField extends React.Component<Props> {
|
||||
placeholder: ""
|
||||
};
|
||||
|
||||
field: ?HTMLInputElement;
|
||||
|
||||
componentDidMount() {
|
||||
if (this.props.autofocus && this.field) {
|
||||
this.field.focus();
|
||||
}
|
||||
}
|
||||
|
||||
handleInput = (event: SyntheticInputEvent<HTMLInputElement>) => {
|
||||
this.props.onChange(event.target.value);
|
||||
};
|
||||
@@ -35,6 +44,9 @@ class InputField extends React.Component<Props> {
|
||||
{this.renderLabel()}
|
||||
<div className="control">
|
||||
<input
|
||||
ref={input => {
|
||||
this.field = input;
|
||||
}}
|
||||
className="input"
|
||||
type={type}
|
||||
placeholder={placeholder}
|
||||
|
||||
Reference in New Issue
Block a user