Selectable List in place

This commit is contained in:
John Lyon-Smith
2018-03-03 11:24:48 -08:00
parent 7756963eb2
commit 3ef0a3bdc9
19 changed files with 312 additions and 194 deletions

View File

@@ -7,13 +7,17 @@ class Row extends Component {
children: PropTypes.node,
minWidth: PropTypes.oneOfType([ PropTypes.string, PropTypes.number ]),
width: PropTypes.oneOfType([ PropTypes.string, PropTypes.number ]),
fillParent: PropTypes.bool,
}
render() {
const { children, width, minWidth } = this.props
const { children, width, minWidth, fillParent } = this.props
return (
<div style={{ height: '100%', display: 'flex', width, minWidth, flexDirection: 'row' }}>{children}</div>
<div style={[
{ display: 'flex', minWidth, width, flexDirection: 'row' },
fillParent && { position: 'absolute', width: '100%', height: '100%' },
]}>{children}</div>
)
}
}
@@ -31,7 +35,9 @@ Row.Item = Radium(class RowLayoutItem extends Component {
const flexGrow = grow ? 1 : null
return (
<div style={{ width, minWidth, flexGrow }}>{children}</div>
<div style={{ position: 'relative', width, minWidth, flexGrow }}>
{children}
</div>
)
}
})