Skip to content
This repository has been archived by the owner on Jun 11, 2021. It is now read-only.

Commit

Permalink
fix(docsearch): capture mousedown event to close modal
Browse files Browse the repository at this point in the history
This doesn't close the modal when selecting the input text and finishing the selection outside of the modal.

See facebook/react-native-website#2139 (comment)
  • Loading branch information
francoischalifour committed Aug 21, 2020
1 parent d652514 commit b802621
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion packages/docsearch-react/src/DocSearchModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -342,7 +342,7 @@ export function DocSearchModal({
]
.filter(Boolean)
.join(' ')}
onClick={(event) => {
onMouseDown={(event) => {
if (event.target === event.currentTarget) {
onClose();
}
Expand Down

0 comments on commit b802621

Please sign in to comment.