rero / rero-ils

Integrated Library System flavour of Invenio by RERO+.
http://ils.test.rero.ch
GNU Affero General Public License v3.0
73 stars 25 forks source link

Typing char or string in integer type field is possible on Firefox, no validation message #1094

Closed AoNoOokami closed 1 year ago

AoNoOokami commented 4 years ago

Describe the bug It is possible to type char, for example 'a', 'b' or 'c', or even string, in integer-type fields when using the editor in Firefox. There is no validation error message to warn the user. Example: provisionActivity.startDate - when adding a letter, the field validation message is "This field is required" ; when adding an integer with only one character (instead of 4), there is no field validation message but a global error on the form "The form contains errors.". Example: partOf - year and pages have a validation (impossible to save a string not integer), but not numbering and volume (we can save a string not integer without error message, but they are not saved).

To Reproduce Steps to reproduce the behavior:

  1. Go to the document editor
  2. Display 'part of' field
  3. Type something in volume or issue field
  4. The record can't be saved. There is no validation message to warn about the wrong type of data.

Expected behavior It shouldn't be possible to type anything else than an integer in those fields.

Context This is related to the behaviour of ngx-formly. Therefore, an issue was reported on the repo: https://github.com/ngx-formly/ngx-formly/issues/2360

Screenshots If applicable, add screenshots to help explain your problem.

iGormilhit commented 4 years ago

@AoNoOokami https://github.com/ngx-formly/ngx-formly/issues/2360 seems to be closed, but I still can reproduce it in v0.14.1. Is it because we have to update ngx-formly in ng-core?

AoNoOokami commented 3 years ago

I think so. I will check that while testing https://github.com/rero/rero-ils-ui/pull/445 and related PRs.

AoNoOokami commented 3 years ago

I tested it on v0.15.0. There is an error if we type char in date 1 of provision activity field, but the message says: This field is required. If I type a date, for example `2020 the field is validated.