1
0
Fork 0

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
This commit is contained in:
François Chalifour 2020-08-21 19:00:33 +02:00
parent 1a0cbbfdbf
commit f9247b9cae

View file

@ -342,7 +342,7 @@ export function DocSearchModal({
]
.filter(Boolean)
.join(' ')}
onClick={(event) => {
onMouseDown={(event) => {
if (event.target === event.currentTarget) {
onClose();
}