React-native-ui-kitten: Input: multiline not displaying properly

Created on 3 Dec 2019  路  2Comments  路  Source: akveo/react-native-ui-kitten

Issue type

I'm submitting a ... (check one with "x")

  • [X] bug report
  • [ ] feature request

Issue description

Current behavior:
Setting multiline/number of lines doesn't work on input. The height stays the same.

Expected behavior:
Setting multiline/number of lines should make the input field bigger in height (according to the number of lines). See: https://facebook.github.io/react-native/docs/textinput

Steps to reproduce:

  1. Add a input component.
  2. Set multiline too true.
  3. Set the number of lines.

Related code:

<Input
  multiline={true}
  numberOfLines={10}
/>

If I'm missing anything here, let me know.

Other information:

OS, device, package version

React Native v0.61.1 on iPhone 11 Pro simulator 11.1.
React Native UI Kitten v4.2.0.
Help wanted Components

Most helpful comment

It does not, see below. Setting minHeight/maxHeight has no affect either. Only when you start typing text, the red box will start growing. But I need to display a bigger one from start.

Code:

<Input
  style={{ backgroundColor: "red", height: 150 }}
  multiline={true}
  numberOfLines={10}
/>

<TextInput
  style={{ backgroundColor: "yellow", height: 150 }}
  multiline={true}
  numberOfLines={10}
/>

Screenshot:

Schermafbeelding 2019-12-04 om 21 35 37

EDIT; I just noticed I need to use the 'textStyle' property you UI Kitten exposes, documentation wasn't really clear for this. So this works:

<Input
  textStyle={{ backgroundColor: "red", height: 150 }}
  multiline={true}
  numberOfLines={10}
/>

All 2 comments

Hi 馃憢
I guess this is standard behavior of TextInput in React Native. Setting minHeight or maxHeight to styles should make it work

It does not, see below. Setting minHeight/maxHeight has no affect either. Only when you start typing text, the red box will start growing. But I need to display a bigger one from start.

Code:

<Input
  style={{ backgroundColor: "red", height: 150 }}
  multiline={true}
  numberOfLines={10}
/>

<TextInput
  style={{ backgroundColor: "yellow", height: 150 }}
  multiline={true}
  numberOfLines={10}
/>

Screenshot:

Schermafbeelding 2019-12-04 om 21 35 37

EDIT; I just noticed I need to use the 'textStyle' property you UI Kitten exposes, documentation wasn't really clear for this. So this works:

<Input
  textStyle={{ backgroundColor: "red", height: 150 }}
  multiline={true}
  numberOfLines={10}
/>
Was this page helpful?
0 / 5 - 0 ratings

Related issues

gimli01 picture gimli01  路  3Comments

eyalyoli picture eyalyoli  路  3Comments

iosdev-republicofapps picture iosdev-republicofapps  路  3Comments

jeloagnasin picture jeloagnasin  路  3Comments

domsterthebot picture domsterthebot  路  3Comments