0

EDIT: Thanks to a comment I found out that this problem only occurs in my Firefox (v80.0.1) - let me know if it works in yours, then it can only be a plugin issue, I guess.

The task is simple: Don't allow non-numerical characters to appear in the Input element. restricted character in input
But because of type="Number" it's not working.
I need to keep the type property though for mobile devices.

Does anyone have some good solutions for this problem?

Here's the example: https://jsfiddle.net/eu4d0vr9/

I have tried the MaskInput too, but I don't want to set the number to any specific length and also the description property does not work anymore then.

P.S.:
I know there are already similar questions here, but they were not asked in the SAPUI5 context and I'd like to know SAPUI5 specific solutions.

Cold_Class
  • 3,214
  • 4
  • 39
  • 82
  • 1
    Your example works for me... (only sth. like e+10 is possible) – Jan Schulz Sep 16 '20 at 13:44
  • So you can't just type in the "a" like me in the screenshot? That's strange...I'm using Firefox, you? – Cold_Class Sep 16 '20 at 13:50
  • 1
    Chrome Version 85.0... – Jan Schulz Sep 16 '20 at 14:22
  • Thx for letting me know, it also works in my Chrome - so I guess it's a Firefox-specific problem... – Cold_Class Sep 16 '20 at 14:22
  • 1
    Unfortunately Firefox hasn't implemented the [specification of the ``](https://html.spec.whatwg.org/multipage/input.html#number-state-(type=number):~:text=User%20agents%20must%20not%20allow%20the%20user%20to%20set%20the%20value%20to%20a%20non-empty%20string%20that%20is%20not%20a%20valid%20floating-point%20number.) fully. Also reported as [Bug 1398528](https://bugzilla.mozilla.org/show_bug.cgi?id=1398528). – Boghyon Hoffmann Sep 19 '20 at 23:32

0 Answers0