egui icon indicating copy to clipboard operation
egui copied to clipboard

iOS: Safari: TextEdit only receives a letter not the text completion

Open kud1ing opened this issue 3 years ago • 1 comments

Steps to reproduce the behavior:

  1. in Safari on iOS go to the web demo
  2. go to a TextEdit
  3. enter a character, e.g. "c"
  4. select a proposed text completion e.g. "can"

Now, only the letter "c" is entered, not the selected text completion.

This only happens for the first word though. If the next suggested word is e.g. "you" and you select "you", indeed "you" is entered. The TextEdit now contains "c you" instead of "can you".

kud1ing avatar Jun 18 '22 08:06 kud1ing

Do you know if there is a JS event generated when you click a completion? If not, this is very difficult to do.

Mobile text input is sort of a hack in eframe right now. Text selection is not working either.

emilk avatar Jul 21 '22 18:07 emilk

The input.addEventListener("input", updateValue); from the example https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event#javascript works for both the initial character and the text completion on iOS for me.

According to eframe's install_text_agent() this is what is used. The difference is that the MDN example uses event.target.value while eframe uses the input fields value. But that should be the same? Maybe instead this is related to update_text_agent()?

On a different note: on macOS Safari the MDN example shows text completion, while the egui examples do not.

kud1ing avatar Sep 28 '23 13:09 kud1ing