I’m facing a strange behavior with focus + keyboar...
# compose
n
I’m facing a strange behavior with focus + keyboard type… All the
TextField
are numeric and when I move the focus to the previous
TextField
, the keyboard type changes very quickly to the alpha numeric and then changes again to the numeric… 😕 Here’s my code: https://gist.github.com/nglauber/312052d2989aff50b9331aa6e0f816f7 And here’s the gif:
n
yes in my case too, on switch keyboard switch to alphanumeric thats why i implemented native otpview
z
File a bug, link in channel topic.
👍 2
n
d
We recently implemented a PIN entry view like this in Compose and SwiftUI. In the end we side stepped a lot of such issues by making the input part a large, invisible, single text field. The large visual digits merely reflect the content of the single invisible field.
👍 1
Sounds like a hack, but the result was simple and works perfectly.
c
How did you fixed it @nglauber or any workaround or hack?
n
I didn’t… there’s a issue opened for that 😞 https://issuetracker.google.com/issues/187746439
c
@nglauber I tried the workaround suggested by @darkmoon_uk, put the textfield with size of 0.dp, and made text styled like edittext box. on click of those texts I use focus requestor for the hidden textfield. Its working
👍 1
K 1
I have added an article on my blog regarding this bug with code example, hope it helps someone with same issue : https://chetangupta.net/keyboard-switch-bug/
🙏 2
2