Skip to content

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 1a0cbbf commit f9247b9
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/DocSearchModal.tsx
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 f9247b9

Please sign in to comment.