tcomb-form-native icon indicating copy to clipboard operation
tcomb-form-native copied to clipboard

numberOfLines is not working

Open emilmammadov opened this issue 5 years ago • 1 comments

Version

  • tcomb-form-native v0.6.20
  • react-native v0.61.1

That is my options. I set multiline: true and numberOfLines is not working. I am expecting to show multiline input.

options = {
    i18n: {
        optional: '',
        required: '*'
    },
    stylesheet: stylesheet,
    fields: {
        comment: {
            label: 'Comment',
            error: 'Check in',
            placeholder: 'i.e comment,
            multiline: true,
            numberOfLines: 4,
        },
    }
};

Actual behaviour

It is showing single line input.

emilmammadov avatar Feb 11 '20 06:02 emilmammadov

As a workaround, you can adjust the style to get it to work. For example I have a multiline Notes field working in v0.6.20 with the following options:

        Notes: {
          multiline: true,
          returnKeyType: 'done',
          blurOnSubmit: true,
          stylesheet: {
            ...Form.stylesheet,
            textbox: {
              ...Form.stylesheet.textbox,
              normal: {
                ...Form.stylesheet.textbox.normal,
                height: 60,
                textAlignVertical: 'top',
              },
              error: {
                ...Form.stylesheet.textbox.error,
                height: 60,
              },
            },
          },
        }

The key pieces there being multiline: true (which you already have) and the added style attributes of height: 60 and textAlignVertical: 'top'.

bogan27 avatar May 30 '20 17:05 bogan27