https://kotlinlang.org logo
Title
j

John O'Reilly

01/14/2022, 4:18 PM
Is there way to know when user has finished selecting say an accented letter (when using for example
TextField
). Looks like, when long-pressing, we get
onValueChange
for the non-accented version first and then again when user picks one of options shown
Ideally I'd want to get single notification that letter has been entered
t

theapache64

01/16/2022, 4:27 AM
@John O'Reilly AFAIK, there’s no way to do that. And I don’t think there will be any. Because, accented letter works as a replacement for the letter that is already typed. I am curios about your requirement. Would you mind explain the usecase?
j

John O'Reilly

01/16/2022, 8:22 AM
I want to automatically move to next field when user types a character.
On Android for example the character isn't entered when you long press but only after you selected character
l

louiscad

01/16/2022, 9:31 AM
But if the character is removed, you can go back to the previous field, can't you?
j

John O'Reilly

01/16/2022, 9:36 AM
I'm not sure I understand what you mean by character being removed? btw this is for the compose for desktop client in https://github.com/joreilly/WordMasterKMP
It could very well be that I'm not using the best "hooks" for triggering this
l

louiscad

01/16/2022, 9:37 AM
macOS is removing the accent-less character when an accented variant is selected, isn't it?
j

John O'Reilly

01/16/2022, 9:38 AM
so, first of all we get
onValueChange
for the initial character....and that's what I had been using to trigger moving to next field....but need to somehow find different way to trigger that. We get 2nd
onValueChange
for the accented character
l

louiscad

01/16/2022, 9:40 AM
If you move to the next field, you don't receive the second
onValueChange
?
j

John O'Reilly

01/16/2022, 9:44 AM
you do get
onValueChange
for the accented character but you've moved to next field at that point and that's where character is entered
l

louiscad

01/16/2022, 9:48 AM
Oh, and there's no way to differentiate it from someone with an azerty keyboard typing an a and an à after that?
j

John O'Reilly

01/16/2022, 9:48 AM
exactly...at least that's what seems to be the case here
l

louiscad

01/16/2022, 9:50 AM
I guess a way would be to have one hidden text input field, and manage display separately, though it'd mess with text selection to some extent.
j

John O'Reilly

01/16/2022, 10:49 AM
Seems like this kind of UX would be common enough for something like OTP entry.....but perhaps that typically doesn't require entering accented characters 🙂
l

louiscad

01/16/2022, 10:49 AM
Yep, that's what I was thinking
t

theapache64

01/17/2022, 3:12 AM
@John O'Reilly Ahaa. got it. valid requirement. 😄 Maybe @Igor Demin might knw if there’s an API/person who can help here.