From f87bb95236311d7600584b6701df7447b635cade Mon Sep 17 00:00:00 2001 From: Aaryan Khandelwal <65252264+aaryan610@users.noreply.github.com> Date: Fri, 26 Apr 2024 18:27:32 +0530 Subject: [PATCH 1/5] chore: clear search term on escape key (#4289) --- web/components/command-palette/command-modal.tsx | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/web/components/command-palette/command-modal.tsx b/web/components/command-palette/command-modal.tsx index aa36eabed7..29734efc9d 100644 --- a/web/components/command-palette/command-modal.tsx +++ b/web/components/command-palette/command-modal.tsx @@ -178,7 +178,9 @@ export const CommandModal: React.FC = observer(() => { return 0; }} onKeyDown={(e) => { - // when search is empty and page is undefined + // when search term is not empty, esc should clear the search term + if (e.key === "Escape" && searchTerm) setSearchTerm(""); + // when user tries to close the modal with esc if (e.key === "Escape" && !page && !searchTerm) closePalette(); From ad27184a91a72905a4b32a9f6b3ad7cea43d8475 Mon Sep 17 00:00:00 2001 From: Aaryan Khandelwal <65252264+aaryan610@users.noreply.github.com> Date: Fri, 26 Apr 2024 18:29:18 +0530 Subject: [PATCH 2/5] [WEB-1072] fix: pages UI improvements (#4294) * fix: outline alignment * fix: textarea auto-resize logic --- packages/ui/src/form-fields/textarea.tsx | 2 +- .../ui/src/hooks/use-auto-resize-textarea.ts | 30 +++++++------------ .../editor/summary/heading-components.tsx | 6 ++-- web/components/pages/editor/title.tsx | 11 +++++-- web/components/pages/list/block.tsx | 2 +- 5 files changed, 25 insertions(+), 26 deletions(-) diff --git a/packages/ui/src/form-fields/textarea.tsx b/packages/ui/src/form-fields/textarea.tsx index 2c47a65f57..e6927a9682 100644 --- a/packages/ui/src/form-fields/textarea.tsx +++ b/packages/ui/src/form-fields/textarea.tsx @@ -15,7 +15,7 @@ const TextArea = React.forwardRef((props, re // refs const textAreaRef = useRef(ref); // auto re-size - useAutoResizeTextArea(textAreaRef); + useAutoResizeTextArea(textAreaRef, value); return (