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

fix: data table header title number of lines not working #3772

Merged

Conversation

pac-guerreiro
Copy link
Collaborator

@pac-guerreiro pac-guerreiro commented Mar 21, 2023

Summary

Data table column titles were stuck on one line, even if numberOfLines > 1.

The problem was that data table header had a fixed height of 48 px.

I updated the data table in the example app to include a column title with two lines.

This issue was reported on #3753.

Test plan

You can use the data table sample on the example app and tweak the numberOfLines and title text.

Right now, the second column is set to show the column title in 2 lines as you can see below:

Screenshot 2023-03-21 at 16 23 40

@github-actions
Copy link

The mobile version of example app from this branch is ready! You can see it here.

@@ -83,7 +83,9 @@ const DataTableExample = () => {
>
Dessert
</DataTable.Title>
<DataTable.Title numeric>Calories</DataTable.Title>
<DataTable.Title numberOfLines={2} numeric>
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It would be nice to add alignItems: 'center' to the styles.container since we can have multiline headers:

image

@lukewalczak lukewalczak merged commit b385389 into main Mar 23, 2023
@lukewalczak lukewalczak deleted the fix/datatable-header-title-number-of-lines-not-working branch March 23, 2023 20:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants