From f9247b9caec89e72f56e76b37861d188b87c0f69 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fran=C3=A7ois=20Chalifour?= Date: Fri, 21 Aug 2020 19:00:33 +0200 Subject: [PATCH] fix(docsearch): capture `mousedown` event to close modal This doesn't close the modal when selecting the input text and finishing the selection outside of the modal. See https://github.com/facebook/react-native-website/pull/2139#issuecomment-678330203 --- src/DocSearchModal.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/DocSearchModal.tsx b/src/DocSearchModal.tsx index 3075787a6..fdb21f8b1 100644 --- a/src/DocSearchModal.tsx +++ b/src/DocSearchModal.tsx @@ -342,7 +342,7 @@ export function DocSearchModal({ ] .filter(Boolean) .join(' ')} - onClick={(event) => { + onMouseDown={(event) => { if (event.target === event.currentTarget) { onClose(); }