From 0a7b80be93eddab1ae39d6eb46ec6915ea983793 Mon Sep 17 00:00:00 2001 From: tienifr Date: Mon, 16 Oct 2023 18:13:57 +0700 Subject: [PATCH] fix: add comment --- src/components/PDFView/PDFPasswordForm.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/components/PDFView/PDFPasswordForm.js b/src/components/PDFView/PDFPasswordForm.js index 76764ca96a86..58a4e64a28a5 100644 --- a/src/components/PDFView/PDFPasswordForm.js +++ b/src/components/PDFView/PDFPasswordForm.js @@ -69,6 +69,10 @@ function PDFPasswordForm({isFocused, isPasswordInvalid, shouldShowLoadingIndicat if (!textInputRef.current) { return; } + /** + * We recommend using setTimeout to wait for the animation to finish and then focus on the input + * Relevant thread: https://expensify.slack.com/archives/C01GTK53T8Q/p1694660990479979 + */ focusTimeoutRef.current = setTimeout(() => { textInputRef.current.focus(); }, CONST.ANIMATED_TRANSITION);