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: some fields should not submit the form #365

Merged
merged 1 commit into from
Mar 16, 2021

Conversation

jma
Copy link
Contributor

@jma jma commented Mar 16, 2021

  • Adds a new doNotSubmitOnEnter boolean templateOptions form property
    to avoid form submission when the enter key is pressed.

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?

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?
  • Extracted translations?

@jma jma force-pushed the maj-do-not-submit-on-enter branch from 4605101 to 80706f3 Compare March 16, 2021 06:49
@jma jma marked this pull request as ready for review March 16, 2021 10:14
@jma jma requested review from sebdeleze and zannkukai March 16, 2021 10:14
@@ -428,12 +428,12 @@ export class EditorComponent implements OnInit, OnChanges, OnDestroy {

if (formOptions) {
this._setSimpleOptions(field, formOptions);
console.log(field.templateOptions);

Choose a reason for hiding this comment

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

Remove this statement

* Adds a new `doNotSubmitOnEnter` boolean templateOptions form property
  to avoid form submission when the enter key is pressed.

Co-Authored-by: Johnny Mariéthoz <Johnny.Mariethoz@rero.ch>
@jma jma force-pushed the maj-do-not-submit-on-enter branch from 80706f3 to af1c5de Compare March 16, 2021 10:44
Copy link
Contributor

@zannkukai zannkukai left a comment

Choose a reason for hiding this comment

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

Does it means that we need to place this templateOptions on each editor field if we want to prevent the editor should not be submit on Enter ?

@jma
Copy link
Contributor Author

jma commented Mar 16, 2021

Does it means that we need to place this templateOptions on each editor field if we want to prevent the editor should not be submit on Enter ?

Exact, this is limited to fields that use a bar code scanner.

@sebdeleze sebdeleze merged commit 46ca399 into rero:dev Mar 16, 2021
@jma jma deleted the maj-do-not-submit-on-enter branch December 13, 2021 10:49
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.

3 participants