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 text should allow growth #180

Merged
merged 1 commit into from
Apr 17, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions example/src/Views/DataTable.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import React from 'react';
import { StyleSheet, ScrollView, Alert } from 'react-native';
import { DataTableCell, DataTableRow, DataTableHeader, DataTableHeaderProps, DataTable, Checkbox, DataTableHeaderSelected } from '@carbon/react-native';
import { DataTableCell, DataTableRow, DataTableHeader, DataTableHeaderProps, DataTable, Checkbox, DataTableHeaderSelected, Text } from '@carbon/react-native';
import AddIcon from '@carbon/icons/es/add/20';
import SearchIcon from '@carbon/icons/es/search/20';
import SettingsIcon from '@carbon/icons/es/settings/20';
Expand Down Expand Up @@ -94,7 +94,7 @@ export default class TestDataTable extends React.Component {
</DataTableRow>
<DataTableRow>
<DataTableCell noPadding={true} width={48} content={<Checkbox style={styles.checkbox} hideLabel={true} label="Checkbox row 2" id="checkbox-2" onPress={(value) => this.setState({ checked2: value })} checked={checked2} />} />
<DataTableCell onPress={() => this.alert('Pressed long name cell')} content="Jack Long name that is going to be too big for screen" />
<DataTableCell onPress={() => this.alert('Pressed long name cell')} content={<Text text="Testing larger text" type="heading-03" />} />
<DataTableCell content="3/4/1985" width={100} />
</DataTableRow>
<DataTableRow onPress={() => this.alert('Pressed row 3')}>
Expand Down
2 changes: 1 addition & 1 deletion src/components/DataTable/DataTableCell.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -40,11 +40,11 @@ export class DataTableCell extends React.Component<DataTableCellProps> {

return StyleSheet.create({
wrapper: {
height: 48,
padding: noPadding ? 0 : 16,
paddingBottom: noPadding ? 0 : 15,
paddingTop: noPadding ? 0 : 15,
flex: 1,
justifyContent: 'center',
},
});
}
Expand Down
3 changes: 1 addition & 2 deletions src/components/DataTable/DataTableRow.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,7 @@ export class DataTableRow extends React.Component<DataTableRowProps> {
return StyleSheet.create({
wrapper: {
backgroundColor: getColor('layer01'),
maxHeight: 48,
height: 48,
minHeight: 48,
flexDirection: 'row',
width: '100%',
borderTopColor: getColor('borderSubtle00'),
Expand Down
Loading