Skip to content

How to have a multiline button? #2583

Description

@EduVencovsky

I'm trying to use the Button component with multiple lines of text, is it even possible?

I was looking at the source code and found that the Text component of the Button have a fixed prop numberOfLines={1}. Maybe it should be possible to customize the Text component passing something like textProps?

I know that multiline button goes agains material design guide lines, but... is it possible?

Activity

  1. github-actions commented on Mar 4, 2021

    @github-actions

    Couldn't find version numbers for the following packages in the issue:

    • react-native
    • react-native-paper
    • react-native-vector-icons

    Can you update the issue to include version numbers for those packages? The version numbers must match the format 1.2.3.

  2. raajnadar commented on Mar 4, 2021

    @raajnadar
    Collaborator

    Did you try

    <Button>
       <Text>Multiline test</Text>
       <Text>Did that work?</Text>
    </Button>
    
  3. EduVencovsky commented on Mar 4, 2021

    @EduVencovsky
    Author

    @raajnadar doesn't work because nested Text components are treated as only one "text" for react native

  4. locked and limited conversation to collaborators on Mar 4, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions