I'm developing an iPad application in React Native in which I want to show number only keypad. I have used keyboard type as phone-pad but is shows numbers alongwith extra characters. How should I achieve that? How should I use the Custom keypad in react native for iOS.
Number Keypad for iPad in React Native
5.8k views Asked by Amit Shetye At
2
There are 2 answers
1
Roshan
On
I am attaching a below screenshot for how many keyboard type you can show along with their respective keywords.
for your case just add
keyboardType="number-pad"
if you are using TextInput for your keyboard
Update: for iPad either you need a custom keyboad which can only contains number only or what you can do is:
Simply remove the the text from number input even if the keyboard has characters
You can do this way
`<TextInput
placeHolder="*********"
keyboardType="number-pad"
onChangeText={this.onChangeText.bind(this)}
value={text}
/>`
`onChangeText(text) {
const numbers = '0123456789';
let numberOnly = '';
for (let i = 0; i < text.length; i++) {
if (numbers.indexOf(text[i]) > -1) {
numberOnly += text[i];
}
}
this.props.passwordChanged(numberOnly); }
Related Questions in IOS
- URLSession requesting JSON array from server not working
- Incorrect display of LinearGradientBrush in IOS
- Module not found when building flutter app for IOS
- How to share metadata of an audio url file to a WhatsApp conversation with friends
- Occasional crash at NSURLSessionDataTask dataTaskWithRequest:completionHandler:
- Expo Deep linking on iOS is not working (because of Google sign-in?)
- On iOS, the keyboard does not offer a 6-character SMS code
- Hi, there is an error happened when I build my flutter app, after I'm installing firebase packages occurs that error
- The copy/paste functionalities don't work only on iOS in the Flutter app
- Hide LiveActivityIntent Button from Shortcuts App
- While Running Github Actions Pipeline: No Signing Certificate "iOS Development" found: No "iOS Development" signing certificate matching team ID
- Actionable notification api call not working in background
- Accessibility : Full keyboard access with scroll view in swiftui
- There is a problem with the request entity - You are not allowed to create 'iOS' profile with App ID 'XXXX'
- I am getting "binding has not yet been initialized" error when trying to connect firebase with flutter
Related Questions in REACT-NATIVE
- ussd reader in Recket Native module
- I can't make TextInput to auto expand properly in Android
- expo config plugin use import instead of require
- Custom Sound for Expo Push Notifications Only Works in Foreground
- run RTK dispatch on gesture start with React Native
- Should I set Back-End for my React Native application?
- using infoPlist in app.json for expo project seems to not be working
- Anyone have success configuring react-native-home-indicator?
- KeyboardAvoidingView makes a messy the flexbox
- I am getting lots of errors when building react native app in Xcode
- Search and highlight text of current text in PDFKit Swift
- Flatlist Sometimes Capped at 10 Items Bug
- Is there any way to page transition in react native (stack navigation)
- Screen inside Stack.Navigator not visible in React-Native
- React Native stopwatch implementation slow on iOS
Related Questions in IPAD
- Site loads on iPad/Chrome but not on iPad/Safari
- Possible to use NFC for iPad
- Intune IpadOS disable Safari quick notes
- Does anyone know how to make iPad layout the same as iPhone's? Size wise the text and overall layout get's smaller when I run the app on the iPad
- How to setup different launch screen image for iPad portrait and landscape mode?
- Appear Circles in ZStack exact image position as navigationSplitView (.balanced) opens or close
- Can I use VS code on Ipad
- Webapp exiting fullscreen when dragging mui slider in iPads
- Why are pointer events disabled when using Apple's pencil in Safari?
- @media print @page margins not working on Mac Safari and iPad
- FontAwesome Icons displays as white on iPad instead of Black as on other platforms making them almost invisible
- SwiftUI .autocorrectionDisabled() behavior not updating with @State BOOL
- SwiftUI Previews Multitasking Options
- Flutter - how to prevent an app being closed by user on IpadPro (iPadOs 17)
- ipadOS 17.4: AVCaptureMetadataOutput delegate not called (qrscanner)
Related Questions in IOS-SIMULATOR
- How to press and hold in Xcode simulator
- Can't move files to Xcode's simulator even using Apple's directions
- Flutter : Exception attempting to connect to the VM Service
- Undefined symbol: _OBJC_CLASS_$_ only on simulator
- How to check if app is running in Xcode simulator from mac terminal?
- Is there a way to programmatically toggle 'freeway drive' on the ios simulator
- NSUserDefaults resets to wrong 'Webkit' content on iOS simulator 17
- iOS Simulator can't connect to a server
- app bundle file is crashing when drag and drop on simulator
- Xcode 15 - having issue while run on simulator but archive build successful
- Invalid App Store link when opening in Safari on iOS Simulator using Swift
- Appium Inspector is unable to find the locator of some UI component for IOS
- Rotate iOS Parallel Device Clones to Landscape Mode via Command Line
- Simulator with iOS 16.4 not appearing on Xcode versions 15.2
- How to use and test Wallet Transaction Shortcut in iOS Simulator?
Related Questions in NUMERIC-KEYPAD
- Using STM32F4 to print keys pressed on a keypad
- Flutter - Numeric keyboard not working with Swiftkey
- How to configure S-Lang (and ncurses) to read a1, c1, etc. keypad keys?
- Numeric Keyboard with Kivy / KivyMD for MDTextField
- Prevent user from clicking on "." in the numeric keypad after having a decimal point already existing in the textfield in flutter
- HTML <input type=“number”>, for mobile devices enter key not working
- Is there a way to show a number pad (preferably with a bubble) in a TextInput field using Kivy and Python? NEW ISSUE WITH CODE
- How to activate numeric keypad on woocommerce checkout fields for mobile users?
- Xamarin Forms Entry Binding two way with nullable decimal does not allow to put decimal point
- How can I get input from undefined number of button Controller
- How to fetch properties or name of paired two or more Bluetooth keyboard( keypad)
- How to insert a number directally in a input through a keypad in javascript?
- Number Keypad for iPad in React Native
- UIKeyCommand for the Enter key on Mac keyboard's numeric keypad
- Opening numeric keypad for text field
Popular Questions
- How do I undo the most recent local commits in Git?
- How can I remove a specific item from an array in JavaScript?
- How do I delete a Git branch locally and remotely?
- Find all files containing a specific text (string) on Linux?
- How do I revert a Git repository to a previous commit?
- How do I create an HTML button that acts like a link?
- How do I check out a remote Git branch?
- How do I force "git pull" to overwrite local files?
- How do I list all files of a directory?
- How to check whether a string contains a substring in JavaScript?
- How do I redirect to another webpage?
- How can I iterate over rows in a Pandas DataFrame?
- How do I convert a String to an int in Java?
- Does Python have a string 'contains' substring method?
- How do I check if a string contains a specific word?
Popular Tags
Trending Questions
- UIImageView Frame Doesn't Reflect Constraints
- Is it possible to use adb commands to click on a view by finding its ID?
- How to create a new web character symbol recognizable by html/javascript?
- Why isn't my CSS3 animation smooth in Google Chrome (but very smooth on other browsers)?
- Heap Gives Page Fault
- Connect ffmpeg to Visual Studio 2008
- Both Object- and ValueAnimator jumps when Duration is set above API LvL 24
- How to avoid default initialization of objects in std::vector?
- second argument of the command line arguments in a format other than char** argv or char* argv[]
- How to improve efficiency of algorithm which generates next lexicographic permutation?
- Navigating to the another actvity app getting crash in android
- How to read the particular message format in android and store in sqlite database?
- Resetting inventory status after order is cancelled
- Efficiently compute powers of X in SSE/AVX
- Insert into an external database using ajax and php : POST 500 (Internal Server Error)

Try adding
keyboardType="number-pad". This solution works on both iOS and Android.