fix: fix table height

1. fix table height when the magicInput has opened search menu
2. fix table height when the page has sub tab

Change-Id: I5f57030d65d0d7e17681d0579fc57c7441e1ecfa
This commit is contained in:
Jingwei.Zhang 2023-09-01 15:18:10 +08:00
parent e1893756d6
commit 961d6d21e1
2 changed files with 13 additions and 3 deletions

View File

@ -346,7 +346,11 @@ class MagicInput extends PureComponent {
<Menu.Item key={it.name}>{it.label}</Menu.Item>
));
return (
<Menu className={styles.menu} onClick={this.handleSelectFilter}>
<Menu
className={styles.menu}
onClick={this.handleSelectFilter}
id="search-items-menu"
>
{this.renderOptionsClose(filters)}
{menuItems}
</Menu>

View File

@ -279,12 +279,18 @@ export default class BaseList extends React.Component {
get tableTopHeight() {
const tableSearchHeader = document.getElementById('sl-table-header-search');
const tableSearchInputItemMenu =
document.getElementById('search-items-menu');
const tableSearchHeight = tableSearchHeader
? tableSearchHeader.scrollHeight
: defaultTableSearchHeight;
const topTotal = navHeight + breadcrumbHeight + tableSearchHeight + padding;
const searchMenuHeight = tableSearchInputItemMenu?.scrollHeight || 0;
const searchHeight = searchMenuHeight
? tableSearchHeight - searchMenuHeight + 10
: tableSearchHeight;
const topTotal = navHeight + breadcrumbHeight + searchHeight + padding;
if (this.hasSubTab) {
return topTotal + tabHeight * 2;
return topTotal + tabHeight * 2 + 20;
}
if (this.hasTab) {
return topTotal + tabHeight;