Skip to content

Project created in order to present a solution when using a TextInput `multine`, to many issues related to these problems that happen within IOS, because the` TextAlignVertical` property does not work as it should in it.

License

Notifications You must be signed in to change notification settings

dededavida/textinput-multiline-multiplataform

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Text Input Multiline Multiplataform

Project created in order to present a solution when using a TextInput `multine`, to many issues related to these problems that happen within IOS, because the` TextAlignVertical` property does not work as it should in it.

Expo Snack

https://snack.expo.io/@david896/textinputmultilinemultiplataform

Made by DavidCruz GitHub last commit

Text Input Multiline Multiplataform, finished 🚀

🔨 Usage

To achieve the same effect, you can wrap your TextInput in a View

const TextInputMultiline = (props) => {
  //instead of using `numberOfLines`, we will use `maxHeight` inside the View to specify the maximum size of the same
  return (
    //define style of your TextInput inside the View
    <View style={{ maxHeight: 150, backgroundColor: "#fff", padding: 15 }}>
      //remove paddingTop for correct the question the positioning
      <TextInput {...props} style={{ paddingTop: 0 }} />
    </View>
  );
};
<TextInputMultiline
  placeholder="Type something cool"
  placeholderTextColor="#fff"
  multiline
  onChangeText={(text) => onChangeText(text)}
  value={value}
/>

Feito com ❤️ by David Cruz

About

Project created in order to present a solution when using a TextInput `multine`, to many issues related to these problems that happen within IOS, because the` TextAlignVertical` property does not work as it should in it.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published