0

enter image description here

I would need that when I click on the input field, only the numeric keyboard comes out.

On smartphones. it works, but trying on the tablet the numeric keyboard comes out as default but gives the user the possibility to be able to change with the letters.

Is there a way to make user unable to change.

import { View, StyleSheet, TextInput } from 'react-native';

export default function App() {
  return (
    <View style={styles.container}>
      <TextInput placeholder="useless placeholder" keyboardType="numeric" />
    </View>
  );
}

const styles = StyleSheet.create({
  container: {
    flex: 1,
    justifyContent: 'center',
    paddingTop: 46,
    backgroundColor: '#ecf0f1',
    padding: 8,
  },
});

1 Answer 1

0

You can refer the keyboard type here

Have u tried keyboardType="number-pad"?

Sign up to request clarification or add additional context in comments.

2 Comments

Already tried it doesn't work.
It seems that phone-pad is the solution.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.