Is there way to know when user has finished select...
# compose-desktop
j
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
@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
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
But if the character is removed, you can go back to the previous field, can't you?
j
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
macOS is removing the accent-less character when an accented variant is selected, isn't it?
j
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
If you move to the next field, you don't receive the second
onValueChange
?
j
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
Oh, and there's no way to differentiate it from someone with an azerty keyboard typing an a and an à after that?
j
exactly...at least that's what seems to be the case here
l
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
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
Yep, that's what I was thinking
t
@John O'Reilly Ahaa. got it. valid requirement. 😄 Maybe @Igor Demin might knw if there’s an API/person who can help here.