Cannot close number keyboard using inputType = "number" on newTextField

I have a newTextField  with user input that I want to be an integer/number only, so I set the inputType = “number”.  Below is my code snippet.   When I test the app on an iOS device, a number keyboard does come up.  But there is no way to close the keyboard.  See attached pic.  Is there something else I need to do?

DBText = native.newTextField(760,623, 78, 55 )

DBText.font = native.newFont( native.systemFontBold, 36 )

DBText.align = “left”

DBText.isEditable = true

DBText.inputType = “number” --displays a number keyboard

DBText.text = “1”

Sounds like an iOS bug.

You might need to provide your own button somewhere on the page and call: https://docs.coronalabs.com/api/library/native/setKeyboardFocus.html with a nil value when the button is pressed.

The normal behavior on iOS is that if you tap outside of the keyboard, it closes.  Simply put a touch listener on the background that dismisses the keyboard.

Rob

Thanks for the note on normal behavior for iOS.  Prior to getting that note from you Rob, I was looking for an app out there with the same keyboard, but did not readily find one.  So I like the ideas above.  Either one would work for me.  I think just putting a listener on the background would work.  However, I do like putting the button too since it makes it very clear to the user to click the button to close the keyboard without guessing.  With the listener on the background, the user just looks for something on the keyboard, then just starts tapping around and “guessing”, and would likely hit the background at some quick point.  I will just do the listener on the background for now, very quick fix.

Thanks much.

Sounds like an iOS bug.

You might need to provide your own button somewhere on the page and call: https://docs.coronalabs.com/api/library/native/setKeyboardFocus.html with a nil value when the button is pressed.

The normal behavior on iOS is that if you tap outside of the keyboard, it closes.  Simply put a touch listener on the background that dismisses the keyboard.

Rob

Thanks for the note on normal behavior for iOS.  Prior to getting that note from you Rob, I was looking for an app out there with the same keyboard, but did not readily find one.  So I like the ideas above.  Either one would work for me.  I think just putting a listener on the background would work.  However, I do like putting the button too since it makes it very clear to the user to click the button to close the keyboard without guessing.  With the listener on the background, the user just looks for something on the keyboard, then just starts tapping around and “guessing”, and would likely hit the background at some quick point.  I will just do the listener on the background for now, very quick fix.

Thanks much.