From 9a55621975e4bee1bef2c907c0b27a365572b3ce Mon Sep 17 00:00:00 2001 From: Pedro Bonamin Date: Tue, 2 Apr 2024 15:17:28 +0200 Subject: [PATCH] fix(tasks): don't open tasks search on hotkey + enter --- .../components/navbar/search/components/SearchPopover.tsx | 5 ++++- .../navbar/search/components/common/SearchWrapper.tsx | 2 +- .../tasks/src/tasks/components/form/fields/TargetField.tsx | 1 - 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/packages/sanity/src/core/studio/components/navbar/search/components/SearchPopover.tsx b/packages/sanity/src/core/studio/components/navbar/search/components/SearchPopover.tsx index cf82f5d0bb8..444e396da2c 100644 --- a/packages/sanity/src/core/studio/components/navbar/search/components/SearchPopover.tsx +++ b/packages/sanity/src/core/studio/components/navbar/search/components/SearchPopover.tsx @@ -29,7 +29,10 @@ export interface SearchPopoverProps { disableIntentLink?: boolean onClose: () => void onItemSelect?: ItemSelectHandler - onOpen: () => void + /** + * If provided, will trigger to open the search popover when user types hotkey + k + */ + onOpen?: () => void open: boolean } diff --git a/packages/sanity/src/core/studio/components/navbar/search/components/common/SearchWrapper.tsx b/packages/sanity/src/core/studio/components/navbar/search/components/common/SearchWrapper.tsx index 67dd4948cf5..013b8f2adce 100644 --- a/packages/sanity/src/core/studio/components/navbar/search/components/common/SearchWrapper.tsx +++ b/packages/sanity/src/core/studio/components/navbar/search/components/common/SearchWrapper.tsx @@ -7,7 +7,7 @@ interface SearchWrapperProps { children: ReactNode hasValidTerms: boolean onClose: () => void - onOpen: () => void + onOpen?: () => void open: boolean } diff --git a/packages/sanity/src/tasks/src/tasks/components/form/fields/TargetField.tsx b/packages/sanity/src/tasks/src/tasks/components/form/fields/TargetField.tsx index 7a38b04c2bf..e711fb47255 100644 --- a/packages/sanity/src/tasks/src/tasks/components/form/fields/TargetField.tsx +++ b/packages/sanity/src/tasks/src/tasks/components/form/fields/TargetField.tsx @@ -236,7 +236,6 @@ export function TargetField(