Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 3 additions & 5 deletions src/components/PDFView/PDFPasswordForm.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,12 @@ import PDFInfoMessage from './PDFInfoMessage';
import compose from '../../libs/compose';
import withLocalize, {withLocalizePropTypes} from '../withLocalize';
import withWindowDimensions, {windowDimensionsPropTypes} from '../withWindowDimensions';
import shouldDelayFocus from '../../libs/shouldDelayFocus';

const propTypes = {
/** If the submitted password is invalid (show an error message) */
isPasswordInvalid: PropTypes.bool,

/** If the password field should be auto-focused */
shouldAutofocusPasswordField: PropTypes.bool,

/** If loading indicator should be shown */
shouldShowLoadingIndicator: PropTypes.bool,

Expand All @@ -36,7 +34,6 @@ const propTypes = {

const defaultProps = {
isPasswordInvalid: false,
shouldAutofocusPasswordField: false,
shouldShowLoadingIndicator: false,
onSubmit: () => {},
onPasswordUpdated: () => {},
Expand Down Expand Up @@ -120,7 +117,8 @@ class PDFPasswordForm extends Component {
errorText={this.props.isPasswordInvalid ? this.props.translate('attachmentView.passwordIncorrect') : this.state.validationErrorText}
onFocus={() => this.props.onPasswordFieldFocused(true)}
onBlur={this.validateAndNotifyPasswordBlur}
autoFocus={this.props.shouldAutofocusPasswordField}
autoFocus
shouldDelayFocus={shouldDelayFocus}
secureTextEntry
/>
<Button
Expand Down
1 change: 0 additions & 1 deletion src/components/PDFView/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,6 @@ class PDFView extends Component {
onSubmit={this.attemptPDFLoad}
onPasswordUpdated={() => this.setState({isPasswordInvalid: false})}
isPasswordInvalid={this.state.isPasswordInvalid}
shouldAutofocusPasswordField={!this.props.isSmallScreenWidth}
onPasswordFieldFocused={this.toggleKeyboardOnSmallScreens}
/>
)}
Expand Down