openui5 icon indicating copy to clipboard operation
openui5 copied to clipboard

iOS Numeric Keyboard for sap.m.Input

Open luciencooper opened this issue 12 years ago • 3 comments

This is more of an enhancement but it would be nice if we could set the pattern attribute of the sap.m.Input because to get a number-only keyboard in iOS you have to set pattern="[0-9]*"

luciencooper avatar Nov 18 '14 14:11 luciencooper

Hi Lucien,

yeah, that definitely sounds worth looking into.

From my observations, on Android 4.1 the keypad without any letters opens anyway when type number is set, so no change there. On iOS 6 either your pattern or inputtype=numeric triggers this "keypad only". A problem is the apparently limited support for those patterns across browsers. But I forwarded this to the responsible product owner to give feedback whether we'd like to support this.

As a workaround you could already achieve this by adding an "onAfterRendering" delegate to the Input and using jQuery to add the attribute (but this might break, when the internal structure changes).

Thanks and regards Andreas

akudev avatar Nov 19 '14 10:11 akudev

Hi Lucien,

It's a valid request. I've added this item to our backlog. Can't give you a timeline though as we're currently in a phase where we're planning some bigger items (with a lot of uncertainty about needed capacity). Once the dust settles I'll squeeze it in. Of course, contributions are also welcome!

Cheers, Thomas

thomaskoetter avatar Nov 20 '14 06:11 thomaskoetter

Hi @LucienCooper,

Input inherits from InputBase and InputBase provides many hook methods at the renderer that you can easily implement what you need. Actually I just checked and Renderer Methods are not documented. We should definitely look into this but you can use writeInnerAttributes method.

So, I am not the fun of proving a control feature which is not running cross-browser, but control should provide the possibility of extension for such requirements.

Please see http://jsbin.com/rotamixodo/1/edit?html,js,output

Regards, Cahit

aborjinik avatar Nov 21 '14 08:11 aborjinik