Is there a way to prevent the mobile keyboard from opening automatically when an input is focused? I am using MUI for my react app, and the TextField component changes its UI when focused. I want this change, but I do not want the mobile keyboard to open automatically when the condition for input focus is true.
<TextField focused={mode === 2} />
The "mode" state determines that when it equals 2, the TextField UI should change to focus mode, but I do not want the mobile keyboard to be triggered automatically.
When the user clicks on the TextField, I want the keyboard to open only when the mode state does not equal 2.
I attempted to use preventDefault, but it did not work as expected.
<TextField focused={mode === 2} onFocus={(e) => e.preventDefault()} />