-
-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
Add numberOfLines prop to DataTableTitle #863
Conversation
@@ -99,7 +104,7 @@ class DataTableTitle extends React.Component<Props, State> { | |||
styles.cell, | |||
sortDirection ? styles.sorted : { color: textColor }, | |||
]} | |||
numberOfLines={1} | |||
numberOfLines={numberOfLines || 1} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Use defaultProps
for the default value
@allcontributors[bot] let's add @Taym95 to contributors for code |
Hi, i am developing the web app using react native. I found this plugin and it is useful for me. However, my datatable title is too long so i add numberofLines want to solve the problem, it doesn't work. It still showing "..." of my long title. Hope can fix this issue. Thanks |
@iamautomaton That's how |
@Trancever Maybe i am not explaining clearly, i will make it more easy to understand. I am writing a report page, i am designing a form which is showing the detail of some applicant information. i want to show "English Name of Applicant" on one of my form title of my report page. However, i set the numberOfLines to two, it still showing one line with "...". I am expecting it will show two line of the title Expected
Actually
Below is my code and the ScreenCap Code:
|
Did you fix this? |
Without this, it does not appear the numberOfLines prop has an effect, as noticed in callstack#848 and callstack#863 With this, it appears to work exactly as expected.
Without this, it does not appear the numberOfLines prop has an effect, as noticed in callstack#848 and callstack#863 With this, it appears to work exactly as expected. Text components require special alignment treatment with word wrapping. Normally a word wrap will force text alignment to flex-start. So we align directly when number of lines is > 1, while respecting the numeric property and it's interaction with RTL languages
I think I repaired the original implementation so that it handles text component's special text alignment issues with wrapping, while allowing a cell height that is a multiple of numberOfLines - patch-package patch available here for testing: #3015 (comment) |
Without this, it does not appear the numberOfLines prop has an effect, as noticed in callstack#848 and callstack#863 With this, it appears to work exactly as expected. Text components require special alignment treatment with word wrapping. Normally a word wrap will force text alignment to flex-start. So we align directly when number of lines is > 1, while respecting the numeric property and it's interaction with RTL languages
My PR attempting to address this is release now in 4.12.0, hopefully it works for everyone! |
Add a
numberOfLines
prop toDataTable.Title
Try to fix #848