Skip to content
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

editor: prevent the enter key to submit the form #1772

Merged
merged 1 commit into from
Mar 30, 2021

Conversation

jma
Copy link
Contributor

@jma jma commented Mar 16, 2021

Co-Authored-by: Johnny Mariéthoz johnny.mariethoz@rero.ch

Why are you opening this PR?

  • Which task/US does it implement?
  • Which issue does it fix?

Dependencies

My PR depends on the following rero-ils-ui's PR(s):

  • rero-ils-ui@dev

How to test?

  • What command should I have to run to test your PR?
  • What should I test through the UI?

Code review check list

  • Commit message template compliance.
  • Commit message without typos.
  • File names.
  • Functions names.
  • Functions docstrings.
  • Unnecessary commited files?
  • Cypress tests successful?

@jma jma force-pushed the maj-do-not-submit-on-enter branch 2 times, most recently from 5b15ce6 to 3b6ed4d Compare March 16, 2021 14:18
@jma jma marked this pull request as ready for review March 16, 2021 14:27
@jma jma requested review from lauren-d and BadrAly March 16, 2021 14:28
import 'bootstrap';
import './tooltip';
import './toast';
import './login';
import './toggle';
import './ills_request';


Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

carriage return could be removed ?

@jma jma force-pushed the maj-do-not-submit-on-enter branch from 3b6ed4d to 30d9085 Compare March 16, 2021 15:30
@pronguen
Copy link
Contributor

It works well for all the cases mentioned in #1421.

One doubt (not blocking): in the patron editor, the barcode field (where the enter behaviour is blocked) is required; it is impossible to save a patron without barcode, ok. But the field never appears with the red error message as a required field (see screenshot below).
image

* Prevents the enter key to submit the form in some fields that may be
  filled though a scanning device.
* Closes rero#1421.

Co-Authored-by: Johnny Mariéthoz <johnny.mariethoz@rero.ch>
@jma jma force-pushed the maj-do-not-submit-on-enter branch from 30d9085 to 48ea41f Compare March 17, 2021 13:23
@jma
Copy link
Contributor Author

jma commented Mar 17, 2021

It works well for all the cases mentioned in #1421.

One doubt (not blocking): in the patron editor, the barcode field (where the enter behaviour is blocked) is required; it is impossible to save a patron without barcode, ok. But the field never appears with the red error message as a required field (see screenshot below).
image

I force the patron information to be required, but it seems it is not enough. I was able to reproduce this in ngx-formly and thus an issue has been open in this project: ngx-formly/ngx-formly#2750

@jma jma merged commit 434c273 into rero:dev Mar 30, 2021
@jma jma deleted the maj-do-not-submit-on-enter branch January 13, 2022 14:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Prevent the enter key to submit the form in some fields that may be filled though a scanning device
5 participants