sap.m.Input: input not restricted by 'type' and a trailing dot appears on Safari/iPad
OpenUI5 version: latest
Browser/version (+device/version): Safari/iPad
Any other tested browsers/devices(OK/FAIL):
URL (minimal example if possible):http://jsbin.com/vumoge/edit?html,js,output
User/password (if required and possible - do not post any confidential information here):
Steps to reproduce the problem:
- On Safari on iPad, bring up the above URL
- Press '2' followed by several spaces
- Observe that a dot (.) now appears after the 2 in the input field
What is the expected result? Expected that the text field restrictions are active in Safari just as they are in other browsers (spaces shouldn't be allowed), and that the dot doesn't appear.
What happens instead? The input control allows you to type in non-integer characters (e.g letters, spaces), even though the 'type' is defined as Number. After typing several spaces, the dot appears.
Any other information? (attach screenshot if possible)
Hi cmastrandrea,
thanks for reporting this! I was able to reproduce this with my IPhone with IOS 8. I will forward this to the control owner and he will keep you updated.
Internal incident id:1580084953
Best regards, Janina
Please be aware that the restriction to only numbers (and numerical signs like + - etc.) for sap.m.input with type = "Number" doesn't work in Internet Explorer 10 on Windows 7 either.
I can easily enter something like this "5564qqasqq****s/!&"$/&asföalsf"
Any comments on this?
UI5 sets the corresponding type attribute to the HTML input tag and does not care about value validation. Different browsers do input validation differently and this is allowed by W3C.
See http://www.w3.org/TR/2012/WD-html5-20121025/states-of-the-type-attribute.html#number-state-(type=number)
In case of erroneous entry, input value is empty. The user still has possibility to type invalid characters but the DOM element value is empty in this case.
The input type attribute is intended primarily to control the soft keyboard layout on touch devices and not for validation.