mirror of
https://github.com/desktop/desktop
synced 2024-08-24 18:57:33 +00:00
Don't display invalid state in GHE login form
This commit is contained in:
parent
ea449936b1
commit
0e5231db5d
|
@ -105,6 +105,7 @@ export class AuthenticationForm extends React.Component<
|
||||||
label="Username or email address"
|
label="Username or email address"
|
||||||
disabled={disabled}
|
disabled={disabled}
|
||||||
required={true}
|
required={true}
|
||||||
|
displayInvalidState={false}
|
||||||
// eslint-disable-next-line jsx-a11y/no-autofocus
|
// eslint-disable-next-line jsx-a11y/no-autofocus
|
||||||
autoFocus={true}
|
autoFocus={true}
|
||||||
onValueChanged={this.onUsernameChange}
|
onValueChanged={this.onUsernameChange}
|
||||||
|
@ -115,6 +116,7 @@ export class AuthenticationForm extends React.Component<
|
||||||
type="password"
|
type="password"
|
||||||
disabled={disabled}
|
disabled={disabled}
|
||||||
required={true}
|
required={true}
|
||||||
|
displayInvalidState={false}
|
||||||
onValueChanged={this.onPasswordChange}
|
onValueChanged={this.onPasswordChange}
|
||||||
/>
|
/>
|
||||||
|
|
||||||
|
|
|
@ -28,6 +28,12 @@ export interface ITextBoxProps {
|
||||||
/** Indicates if input field should be required */
|
/** Indicates if input field should be required */
|
||||||
readonly required?: boolean
|
readonly required?: boolean
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Indicates whether or not the control displays an invalid state.
|
||||||
|
* Default: true
|
||||||
|
*/
|
||||||
|
readonly displayInvalidState?: boolean
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Called when the user changes the value in the input field.
|
* Called when the user changes the value in the input field.
|
||||||
*
|
*
|
||||||
|
@ -244,7 +250,11 @@ export class TextBox extends React.Component<ITextBoxProps, ITextBoxState> {
|
||||||
const inputId = label ? this.state.inputId : undefined
|
const inputId = label ? this.state.inputId : undefined
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className={classNames('text-box-component', className)}>
|
<div
|
||||||
|
className={classNames('text-box-component', className, {
|
||||||
|
'no-invalid-state': this.props.displayInvalidState === false,
|
||||||
|
})}
|
||||||
|
>
|
||||||
{label && <label htmlFor={inputId}>{label}</label>}
|
{label && <label htmlFor={inputId}>{label}</label>}
|
||||||
|
|
||||||
<input
|
<input
|
||||||
|
|
Loading…
Reference in a new issue