openui5 icon indicating copy to clipboard operation
openui5 copied to clipboard

sap.m.Input: input not restricted by 'type' and a trailing dot appears on Safari/iPad

Open cmastrandrea opened this issue 11 years ago • 3 comments

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:

  1. On Safari on iPad, bring up the above URL
  2. Press '2' followed by several spaces
  3. 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)

cmastrandrea avatar Sep 09 '15 18:09 cmastrandrea

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

blaesius avatar Sep 15 '15 06:09 blaesius

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?

Frank683 avatar Oct 27 '15 10:10 Frank683

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.

ulasenka avatar Nov 04 '15 16:11 ulasenka