Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
kud1ing opened this issue Jun 18, 2022 · 2 comments
Open

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

kud1ing opened this issue Jun 18, 2022 · 2 comments
Labels
bug Something is broken

Comments

@kud1ing
Copy link
Contributor

kud1ing commented Jun 18, 2022

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 kud1ing added the bug Something is broken label Jun 18, 2022
@kud1ing kud1ing changed the title iOS: Safari: Text completion only receives a letter not the texte completion iOS: Safari: Text completion only receives a letter not the text completion Jun 18, 2022
@kud1ing kud1ing changed the title iOS: Safari: Text completion only receives a letter not the text completion iOS: Safari: TextEdit only receives a letter not the text completion Jun 18, 2022
@emilk
Copy link
Owner

emilk commented Jul 21, 2022

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.

@kud1ing
Copy link
Contributor Author

kud1ing commented Sep 28, 2023

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something is broken
Projects
None yet
Development

No branches or pull requests

2 participants