8000 Fix(login): Users can now submit form with enter as expected by jonathanarnault · Pull Request #2423 · Inist-CNRS/lodex · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Fix(login): Users can now submit form with enter as expected #2423

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jan 28, 2025
Merged
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
12 changes: 6 additions & 6 deletions src/app/js/user/LoginForm.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@ import withHandlers from 'recompose/withHandlers';
import { Field, reduxForm, propTypes as reduxFormPropTypes } from 'redux-form';
import FormTextField from '../lib/components/FormTextField';

import { translate } from '../i18n/I18NContext';
import Alert from '../lib/components/Alert';
import { polyglot as polyglotPropTypes } from '../propTypes';
import { LOGIN_FORM_NAME } from './';
import Alert from '../lib/components/Alert';
import { translate } from '../i18n/I18NContext';

const validate = (values, { p: polyglot }) => {
const errors = ['username', 'password'].reduce((currentErrors, field) => {
Expand Down Expand Up @@ -68,6 +68,10 @@ LoginFormComponent.propTypes = {

export default compose(
translate,
reduxForm({
form: LOGIN_FORM_NAME,
validate,
}),
withHandlers({
handleKeyPress:
({ handleSubmit }) =>
Expand All @@ -77,8 +81,4 @@ export default compose(
}
},
}),
reduxForm({
form: LOGIN_FORM_NAME,
validate,
}),
)(LoginFormComponent);
Loading
0