1
0
-1

HI,

in Maestro is there a way to force the numeric keypad for input type = Number?

For mobile numbers, this works, but not for numbers. There does not appear to be a setting to match the input type with the keyboard type.


Thanks

Mark

    CommentAdd your comment...

    1 answer

    1.  
      1
      0
      -1

      Hey Mark,

      The mobile numeric keyboard should load for any text field with input type == 'number'.

      You can control that setting in Maestro for text field components in the input type dropdown in the properties pane. That option is not available for currency field components, which use input type == 'text' in order to avoid funny JavaScript behavior with floating point numbers etc.

      *If you end up needing to load the numeric keyboard for an input field you would prefer to keep as a text field for any reason (including a currency field), I have used the following jQuery commands to convert a field's type to 'number' while inputting is taking place, and convert it back before the value is changed in order to output a string after using the numeric keyboard (to avoid the issues with JavaScript's number handling):

      (Just add these two to any other Maestro rule that will fire before the user will use the input field)

      $('#idOfInputField').on('touchstart', function() {
        $(this).attr('type', 'number')
      })

      $('#idOfInputField').change(function () {
        $(this).attr('type', 'text')
      })


      Hope this helps!


      1. Mark Murray

        Hi Jamie,

        thanks for the feedback. That was the behavior I was expecting, but was having some trouble getting it to work.

        I have made some changes to fields to set the input type as number and it now behaves as expected. At least it does when I test it on my Android device. Some other testers seem to have issues with iPhones. So I may need ot explore this a bit further, but at least I have some definition of what should happen.


        Thanks

        Mark

      CommentAdd your comment...