Skip to content

Commit

Permalink
Fix table sizing/resizing
Browse files Browse the repository at this point in the history
Signed-off-by: Volker Theile <vtheile@suse.com>
  • Loading branch information
votdev committed Sep 12, 2023
1 parent 74ad6ef commit 78284d6
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/routes/objectStorage/ObjectStoreList.js
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ function list({
]

return (
<div id="objectStoreTable">
<div id="objectStoreTable" style={{ flex: 1, height: '1px', overflow: 'hidden' }}>
<Table
className="common-table-class"
bordered={false}
Expand All @@ -99,7 +99,7 @@ function list({

list.propTypes = {
dataSource: PropTypes.array,
heigth: PropTypes.number,
height: PropTypes.number,
loading: PropTypes.bool,
rowSelection: PropTypes.object,
editObjectStore: PropTypes.func,
Expand Down
15 changes: 15 additions & 0 deletions src/routes/objectStorage/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import EditObjectStore from './EditObjectStore'
import ObjectStoreList from './ObjectStoreList'
import ObjectStoreBulkActions from './ObjectStoreBulkActions'
import { generateRandomKey } from './helper/index'
import C from '../../utils/constants'

class ObjectStore extends React.Component {
constructor(props) {
Expand All @@ -24,6 +25,20 @@ class ObjectStore extends React.Component {
}
}

componentDidMount() {
let height = document.getElementById('objectStoreTable').offsetHeight - C.ContainerMarginHeight
this.setState({
height,
})
window.onresize = () => {
height = document.getElementById('objectStoreTable').offsetHeight - C.ContainerMarginHeight
this.setState({
height,
})
this.props.dispatch({ type: 'app/changeNavbar' })
}
}

showCreateModal = () => {
this.setState({
...this.state,
Expand Down

0 comments on commit 78284d6

Please sign in to comment.