-
-
Notifications
You must be signed in to change notification settings - Fork 32.3k
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
[Table] SelectField in Table getting cut off #2186
Comments
First, give your table enough height, then set your { whiteSpace: 'normal'
, overflow: 'visible'
} For the record, there some work being done to address this issue for all components. see #2043. |
Works great. Thanks for your speedy reply. I used the approach presented in #1702 to get rid of the checkboxes, and It would be nice to be able to prevent the |
@celiao You're welcome ^^
It's possible, export default class TableSelectField extends React.Component {
render() {
const styles = {
cell: {
paddingBottom: 0,
paddingRight: 0,
whiteSpace: 'normal',
overflow: 'visible',
},
field: {
fontSize,
width: '100%',
height: '100%',
},
label: {
padding: 0,
top: '50%',
transform: 'translate(0, -50%)',
},
icon: {
top: '50%',
transform: 'translate(0, -50%)',
},
underline: {
display: 'none',
},
menu: {
width: '100%',
},
}
return (
<TableRowColumn
onClick={this.props.disabled ? this.props.onClick : () => { } }
hoverable={this.props.hoverable}
onHover={this.props.onHover}
onHoverExit={this.props.onHoverExit}
style={assign(styles.cell, this.props.style) }>
<DropDownMenu
value={this.props.selectedItemId}
style={styles.field}
labelStyle={styles.label}
iconStyle={styles.icon}
underlineStyle={styles.underline}
menuItemStyle={styles.menu}
autoWidth={false}
disabled={this.props.disabled}
onChange={this.props.onChange}
menuItems={this.props.items}/>
</TableRowColumn>
)
}
} To use this you can simply replace <Table height={'300px'} selectable={true}>
<TableHeader adjustForCheckbox={false} displaySelectAll={false}>
<TableRow>
...
</TableRow>
</TableHeader>
<TableBody displayRowCheckbox={false} showRowHover={false} stripedRows={true}>
<TableRow>
<TableSelectField .../>
</TableRow>
</TableBody>
</Table> |
I would like to place a
SelectField
component in aTable
cell, but theSelectField
menu is getting truncated to the height of the row. How can the full menu be displayed?The text was updated successfully, but these errors were encountered: