Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

numberOfLines is not working #588

Open
emilmammadov opened this issue Feb 11, 2020 · 1 comment
Open

numberOfLines is not working #588

emilmammadov opened this issue Feb 11, 2020 · 1 comment

Comments

@emilmammadov
Copy link

emilmammadov commented Feb 11, 2020

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.

@bogan27
Copy link

bogan27 commented May 30, 2020

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'.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants