From 612088b9b9f6e411c03fe2adc2d7ca668b4555db Mon Sep 17 00:00:00 2001 From: Yash Dhandha Date: Wed, 13 Sep 2023 22:40:07 +0530 Subject: [PATCH] Fix: Mobile Chrome Jumpy MagicCodeInput --- src/components/MagicCodeInput.js | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/components/MagicCodeInput.js b/src/components/MagicCodeInput.js index b21a275a6597..454aacc8a03b 100644 --- a/src/components/MagicCodeInput.js +++ b/src/components/MagicCodeInput.js @@ -258,7 +258,13 @@ function MagicCodeInput(props) { {/* Hide the input above the text. Cannot set opacity to 0 as it would break pasting on iOS Safari. */} (inputRefs.current[index] = ref)} + ref={(ref) => { + inputRefs.current[index] = ref; + // Setting attribute type to "search" to prevent Password Manager from appearing in Mobile Chrome + if (ref && ref.setAttribute) { + ref.setAttribute('type', 'search'); + } + }} autoFocus={index === 0 && props.autoFocus} inputMode="numeric" textContentType="oneTimeCode"