From 0b40c0b0b2a40dee5bd1df3ac655803d108f1c79 Mon Sep 17 00:00:00 2001 From: Dawood Date: Mon, 27 Mar 2023 08:35:57 -0400 Subject: [PATCH 1/5] fixes --- gradio/components.py | 5 ++++- ui/packages/chatbot/src/ChatBot.svelte | 2 +- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/gradio/components.py b/gradio/components.py index 8270880517095..4e44cd1e7e022 100644 --- a/gradio/components.py +++ b/gradio/components.py @@ -419,7 +419,10 @@ def __init__( # self.lines = lines - self.max_lines = max_lines if type == "text" else 1 + if type == "text": + self.max_lines = lines if lines > max_lines else max_lines + else: + self.max_lines = 1 self.placeholder = placeholder self.select: EventListenerMethod """ diff --git a/ui/packages/chatbot/src/ChatBot.svelte b/ui/packages/chatbot/src/ChatBot.svelte index 8f55ee06a9d6e..ca416f4985114 100644 --- a/ui/packages/chatbot/src/ChatBot.svelte +++ b/ui/packages/chatbot/src/ChatBot.svelte @@ -24,7 +24,7 @@ beforeUpdate(() => { autoscroll = - div && div.offsetHeight + div.scrollTop > div.scrollHeight - 20; + div && div.offsetHeight + div.scrollTop > div.scrollHeight - 100; }); afterUpdate(() => { From 8fdcfbb20a68ada437de58d2a3665c05833f2f57 Mon Sep 17 00:00:00 2001 From: Dawood Date: Mon, 27 Mar 2023 08:43:17 -0400 Subject: [PATCH 2/5] changelog --- CHANGELOG.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 464cdf7144f25..24f7661d1f218 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -12,7 +12,9 @@ - Fixes `Chatbot` and `Image` components so that files passed during processing are added to a directory where they can be served from, by [@abidlabs](https://github.com/abidlabs) in [PR 3523](https://github.com/gradio-app/gradio/pull/3523) - Use Gradio API server to send telemetry using `huggingface_hub` [@dawoodkhan82](https://github.com/dawoodkhan82) in [PR 3488](https://github.com/gradio-app/gradio/pull/3488) - Fixes an an issue where if the Blocks scope was not exited, then State could be shared across sessions, by [@abidlabs](https://github.com/abidlabs) in [PR 3600](https://github.com/gradio-app/gradio/pull/3600) -- Fixed bug where "or" was not being localized in file upload text by [@freddyaboulton](https://github.com/freddyaboulton) in [PR 3599](https://github.com/gradio-app/gradio/pull/3599) +- Fixed bug where "or" was not being localized in file upload text by [@freddyaboulton](https://github.com/freddyaboulton) in [PR 3599](https://github.com/gradio-app/gradio/pull/3599) +- Fixed bug where chatbot does not autoscroll inside of a tab, row or column by [@dawoodkhan82](https://github.com/dawoodkhan82) in [PR ](https://github.com/gradio-app/gradio/pull/) +- Fixed bug where textbox shrinks when `lines` set to larger than 20 by [@dawoodkhan82](https://github.com/dawoodkhan82) in [PR ](https://github.com/gradio-app/gradio/pull/) ## Documentation Changes: From 59c19aea69a8e009c8b804dbe0321552822c575c Mon Sep 17 00:00:00 2001 From: Dawood Khan Date: Mon, 27 Mar 2023 10:56:48 -0400 Subject: [PATCH 3/5] Update gradio/components.py Co-authored-by: Abubakar Abid --- gradio/components.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gradio/components.py b/gradio/components.py index 4e44cd1e7e022..2a7695399f110 100644 --- a/gradio/components.py +++ b/gradio/components.py @@ -420,7 +420,7 @@ def __init__( # self.lines = lines if type == "text": - self.max_lines = lines if lines > max_lines else max_lines + self.max_lines = max(lines, max_lines) else: self.max_lines = 1 self.placeholder = placeholder From b5031e66c6ee81b7251edded050f1a1807501fe5 Mon Sep 17 00:00:00 2001 From: Dawood Khan Date: Mon, 27 Mar 2023 10:58:01 -0400 Subject: [PATCH 4/5] Update CHANGELOG.md --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 46bff3cca6224..d9e787ddceed9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -13,7 +13,7 @@ - Use Gradio API server to send telemetry using `huggingface_hub` [@dawoodkhan82](https://github.com/dawoodkhan82) in [PR 3488](https://github.com/gradio-app/gradio/pull/3488) - Fixes an an issue where if the Blocks scope was not exited, then State could be shared across sessions, by [@abidlabs](https://github.com/abidlabs) in [PR 3600](https://github.com/gradio-app/gradio/pull/3600) - Fixed bug where "or" was not being localized in file upload text by [@freddyaboulton](https://github.com/freddyaboulton) in [PR 3599](https://github.com/gradio-app/gradio/pull/3599) -- Fixed bug where chatbot does not autoscroll inside of a tab, row or column by [@dawoodkhan82](https://github.com/dawoodkhan82) in [PR ](https://github.com/gradio-app/gradio/pull/) +- Fixed bug where chatbot does not autoscroll inside of a tab, row or column by [@dawoodkhan82](https://github.com/dawoodkhan82) in [PR 3637](https://github.com/gradio-app/gradio/pull/3637) - Fixed bug where textbox shrinks when `lines` set to larger than 20 by [@dawoodkhan82](https://github.com/dawoodkhan82) in [PR ](https://github.com/gradio-app/gradio/pull/) - Ensure CSS has fully loaded before rendering the application, by [@pngwn](https://github.com/pngwn) in [PR 3573](https://github.com/gradio-app/gradio/pull/3573) From a5aebbfa958213100ec77404dbcc3a54e9e313cd Mon Sep 17 00:00:00 2001 From: Dawood Khan Date: Mon, 27 Mar 2023 10:58:25 -0400 Subject: [PATCH 5/5] Update CHANGELOG.md --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index d9e787ddceed9..fa1bf154687cb 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -14,7 +14,7 @@ - Fixes an an issue where if the Blocks scope was not exited, then State could be shared across sessions, by [@abidlabs](https://github.com/abidlabs) in [PR 3600](https://github.com/gradio-app/gradio/pull/3600) - Fixed bug where "or" was not being localized in file upload text by [@freddyaboulton](https://github.com/freddyaboulton) in [PR 3599](https://github.com/gradio-app/gradio/pull/3599) - Fixed bug where chatbot does not autoscroll inside of a tab, row or column by [@dawoodkhan82](https://github.com/dawoodkhan82) in [PR 3637](https://github.com/gradio-app/gradio/pull/3637) -- Fixed bug where textbox shrinks when `lines` set to larger than 20 by [@dawoodkhan82](https://github.com/dawoodkhan82) in [PR ](https://github.com/gradio-app/gradio/pull/) +- Fixed bug where textbox shrinks when `lines` set to larger than 20 by [@dawoodkhan82](https://github.com/dawoodkhan82) in [PR 3637](https://github.com/gradio-app/gradio/pull/3637) - Ensure CSS has fully loaded before rendering the application, by [@pngwn](https://github.com/pngwn) in [PR 3573](https://github.com/gradio-app/gradio/pull/3573) ## Documentation Changes: