Is there a way to force the Text Input component to use the numeric keypad in mobile view?
The purpose of this is to implement OTP fields that allow a user to automatically jump to the next box every time they type a number. Additionally, if they have a 6-digit code, they can paste it into one of the boxes, and it will auto-fill. The only problem is that on iOS, the keyboard defaults to QWERTY mode, making it difficult to input the One-Time Password.
Unfortunately we don't have any update on the numberInput request that would allow events to trigger on component change (without using stepper).
Can I ask if this for an app that you want to be using on mobile and on desktop? If it's for a mobile only use and you build the app as a mobile app then the numberInput component can be triggered onChange without using the stepper. The limitation you are describing is limited to Desktop apps (that can run on mobile).
Since the numberInput.value isn't reflected in the state until the user clicks outside the field, as you found, I can't think of a workaround to trigger the event. As you have also found we are stuck there.
I was trying to see what other ways you have around the blocker you are facing - unfortunately there's no way to force a number display on the textInput component input.
The editableNumber component has the same limitation here so that wouldn't work as a solution.
You could potentially use multiple day (date) components here as in this example
Or you could build a custom component for this.... but that would be a significant bit of work.
I also tried creating a custom OTP field component and added a change event handler using Retool.useEventCallback. However, I discovered that the Control Component has very limited options, such as the lack of a Focus option, and clearing the value.
To simplify things, I decided to redesign our OTP field to use a single number input like this:
Hi @Alice, I found another issue with the Number Input Component: it truncates leading zeros. For example, 01 becomes 1. Unfortunately, I couldn't find a workaround because we need to use the Number Input Component to display a numeric keyboard on mobile devices.
Here’s what happens when you paste a code that starts with 0:
After clicking outside the number input component, 099174 becomes 99174:
Unfortunately, OTP code can start with zero values.
If there's no other way, then I'll try to create a custom component with