From fe4a987ef2cc41c447af4dc2557e68e1dacc9f4b Mon Sep 17 00:00:00 2001 From: Josh Vera Date: Mon, 22 Jul 2024 18:39:14 -0400 Subject: [PATCH] Fix Input Toolbar layout (#1792) * set to flex flex-column * Remove fixed height and always show the StyledDivs content to hold its size --- gui/src/components/mainInput/InputToolbar.tsx | 21 +++++-------------- gui/src/components/mainInput/TipTapEditor.tsx | 3 ++- 2 files changed, 7 insertions(+), 17 deletions(-) diff --git a/gui/src/components/mainInput/InputToolbar.tsx b/gui/src/components/mainInput/InputToolbar.tsx index 6fd815b27..0bd113e6b 100644 --- a/gui/src/components/mainInput/InputToolbar.tsx +++ b/gui/src/components/mainInput/InputToolbar.tsx @@ -23,27 +23,19 @@ import { } from "../../util"; import ModelSelect from "../modelSelection/ModelSelect"; -const paddingTop = 4; -const height = 20; - -const StyledDiv = styled.div<{ hidden?: boolean }>` +const StyledDiv = styled.div<{ isHidden: boolean }>` display: flex; justify-content: space-between; flex-wrap: wrap-reverse; flex-direction: row-reverse; gap: 1px; background-color: ${vscInputBackground}; - padding-top: ${paddingTop}px; - - height: ${height}px; - - ${(props) => (props.hidden ? "display: none;" : "")} - align-items: center; z-index: 50; font-size: ${getFontSize() - 4}px; - - cursor: text; + cursor: ${props => props.isHidden ? 'default' : 'text'}; + opacity: ${props => props.isHidden ? 0 : 1}; + pointer-events: ${props => props.isHidden ? 'none' : 'auto'}; & > * { flex: 0 0 auto; @@ -90,11 +82,8 @@ function InputToolbar(props: InputToolbarProps) { return ( <> - {props.hidden && ( -
- )}