Holiday Notice: Support will be provided on a limited scale from December 24th, 2024, to January 2nd, 2025. Happy holidays and a wonderful New Year!


Topic: Number input field

smoehrle free asked 4 years ago


With firefox, when I type characters into a number input, the animation breaks. Chromium prevents me from entering characters.

Expected behavior Same behavior as in Chromium.

Actual behavior I can enter characters into a number input

Resources (screenshots, code snippets etc.) Can be reproduced with the number input in the docs: https://mdbootstrap.com/docs/standard/forms/input-fields/#subsection-number


Mikołaj Smoleński staff commented 4 years ago

Thanks for reporting about an issue. I'm adding it to our list of high priority bugs. Best regards


Mikołaj Smoleński staff answered 4 years ago


After checking the error in detail, I can say that it is not on the side of MDB, but on the side of Firefox native behavior.

Mozilla allows users to enter any value in input, and if it is not correct, validation starts. This is the default behavior of this browser and unfortunately, we have no influence on it.

This behavior is described here: https://bugzilla.mozilla.org/show_bug.cgi?id=1398528

Best regards


smoehrle free commented 4 years ago

Displaying the user a validation error, when he/she enters something else than a number is fine for me. The issue is that the animation breaks. When there is an input which contains at least one character the label hovers back over the input instead of staying in the top left as it should

Best regards


Mikołaj Smoleński staff commented 4 years ago

Firefox treats input value as null when finding non-numeric characters. To prevent this from happening, it would be necessary to prepare a method that listens to input and checks everything the user enters, blocking any characters other than numbers. Unfortunately, this is still a browser bug that we have no influence on. Best regards



Please insert min. 20 characters.

FREE CONSULTATION

Hire our experts to build a dedicated project. We'll analyze your business requirements, for free.

Status

Answered

Specification of the issue

  • ForumUser: Free
  • Premium support: No
  • Technology: MDB Standard
  • MDB Version: 1.0.0
  • Device: N/A
  • Browser: Firefox
  • OS: Ubuntu
  • Provided sample code: No
  • Provided link: Yes
Tags