1
0
mirror of https://github.com/desktop/desktop synced 2024-07-07 19:29:36 +00:00

Don't display invalid state in GHE login form

This commit is contained in:
Sergio Padrino 2023-04-20 12:52:34 +02:00
parent ea449936b1
commit 0e5231db5d
2 changed files with 13 additions and 1 deletions

View File

@ -105,6 +105,7 @@ export class AuthenticationForm extends React.Component<
label="Username or email address"
disabled={disabled}
required={true}
displayInvalidState={false}
// eslint-disable-next-line jsx-a11y/no-autofocus
autoFocus={true}
onValueChanged={this.onUsernameChange}
@ -115,6 +116,7 @@ export class AuthenticationForm extends React.Component<
type="password"
disabled={disabled}
required={true}
displayInvalidState={false}
onValueChanged={this.onPasswordChange}
/>

View File

@ -28,6 +28,12 @@ export interface ITextBoxProps {
/** Indicates if input field should be required */
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.
*
@ -244,7 +250,11 @@ export class TextBox extends React.Component<ITextBoxProps, ITextBoxState> {
const inputId = label ? this.state.inputId : undefined
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>}
<input