From 06aba3e2ba3b080f379208f0642f68131c207e04 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fred=20Lef=C3=A9v=C3=A8re-Laoide?= <90181748+FredLL-Avaiga@users.noreply.github.com> Date: Tue, 20 Aug 2024 11:19:17 +0200 Subject: [PATCH] chat height default unit is px (#1681) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit resolves #1586 Co-authored-by: Fred Lefévère-Laoide --- frontend/taipy-gui/src/components/Taipy/Chat.tsx | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/frontend/taipy-gui/src/components/Taipy/Chat.tsx b/frontend/taipy-gui/src/components/Taipy/Chat.tsx index e4ec2dfa48..84f097ea63 100644 --- a/frontend/taipy-gui/src/components/Taipy/Chat.tsx +++ b/frontend/taipy-gui/src/components/Taipy/Chat.tsx @@ -158,7 +158,7 @@ const ChatRow = (props: ChatRowProps) => { ); }; -const getChatKey = (start: number, page: number) => `Chat-${start}-${start+page}` +const getChatKey = (start: number, page: number) => `Chat-${start}-${start + page}`; const Chat = (props: ChatProps) => { const { id, updateVarName, senderId = "taipy", onAction, withInput = true, defaultKey = "", pageSize = 50 } = props; @@ -184,7 +184,7 @@ const Chat = (props: ChatProps) => { props.height ? ({ ...defaultBoxSx, - maxHeight: props.height, + maxHeight: "" + Number(props.height) == "" + props.height ? props.height + "px" : props.height, display: "flex", flexDirection: "column", } as SxProps) @@ -291,14 +291,14 @@ const Chat = (props: ChatProps) => { if (!refresh && props.messages && page.current.key && props.messages[page.current.key] !== undefined) { const newValue = props.messages[page.current.key]; if (newValue.rowcount == 0) { - setRows(emptyArray) + setRows(emptyArray); } else { const nr = newValue.data as RowType[]; if (Array.isArray(nr) && nr.length > newValue.start && nr[newValue.start]) { setRows((old) => { old.length && nr.length > old.length && setShowMessage(true); if (nr.length < old.length) { - return nr.concat(old.slice(nr.length)) + return nr.concat(old.slice(nr.length)); } if (old.length > newValue.start) { return old.slice(0, newValue.start).concat(nr.slice(newValue.start));