From 961d6d21e1d94a32ada22939a8777ac96dc95c3d Mon Sep 17 00:00:00 2001 From: "Jingwei.Zhang" Date: Fri, 1 Sep 2023 15:18:10 +0800 Subject: [PATCH] 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 --- src/components/MagicInput/index.jsx | 6 +++++- src/containers/List/index.jsx | 10 ++++++++-- 2 files changed, 13 insertions(+), 3 deletions(-) diff --git a/src/components/MagicInput/index.jsx b/src/components/MagicInput/index.jsx index b8abc5dd..65d6a173 100644 --- a/src/components/MagicInput/index.jsx +++ b/src/components/MagicInput/index.jsx @@ -346,7 +346,11 @@ class MagicInput extends PureComponent { {it.label} )); return ( - + {this.renderOptionsClose(filters)} {menuItems} diff --git a/src/containers/List/index.jsx b/src/containers/List/index.jsx index 629b73ab..9bec2ed6 100644 --- a/src/containers/List/index.jsx +++ b/src/containers/List/index.jsx @@ -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;