DEV Community

Daniel Melo
Daniel Melo

Posted on

1

How to disable keyboard suggestions for Android in React Native

I encountered a problem with TextInput on my Samsung S21. If I set the keyboard type to numeric (and the same goes for number-pad/decimal-pad), it always displays phone number suggestions despite the autoComplete flag being set to off.

It was annoying to debug, for example, changing the value of importantForAutofill seemed to fix the problem, but it reappeared after reinstalling. I also found out it was happening only with the Google autofill service, while with Samsung Pass autofill, autoComplete seemed to behave as expected.

After more debugging, I figured out it is a bug that only happens with fields that have a placeholder. Therefore, the solution was a bit ugly, as I had to implement a custom placeholder for Android.

Custom Placeholder

Here is the Snack: Custom Placeholder

Top comments (0)

Sentry mobile image

App store rankings love fast apps - mobile vitals can help you get there

Slow startup times, UI hangs, and frozen frames frustrate users—but they’re also fixable. Mobile Vitals help you measure and understand these performance issues so you can optimize your app’s speed and responsiveness. Learn how to use them to reduce friction and improve user experience.

Read full post →

👋 Kindness is contagious

Please leave a ❤️ or a friendly comment on this post if you found it helpful!

Okay