Skip to content

[IOS] lineHeight breaks textAlignment on Button label when multiline #8151

@sylann

Description

@sylann

I expect the following code to render a button with text centered inside.
But on IOS, the text aligns left as soon as there is more than one line.

<Button textWrap="true" textAlign="center">
  <FormattedString>
    <Span text="Start of text" />
    <Span text=" " />
    <Span text="next part of text" />
  </FormattedString>
</Button>

see screenshot below:

image

1st case: content wraps inside the button and is aligned left

2nd case: content does not wrap and is aligned center as expected

EDIT:
The problem also happen in a simple button. Is it apple that does not support centered multiline label on buttons?

<Button text="a long text that wraps on a second line" textWrap="true" textAlign="center" />

image

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions