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

mobile/ios textarea focus not working #4879

Closed
frederik-uni opened this issue Jul 26, 2024 · 1 comment
Closed

mobile/ios textarea focus not working #4879

frederik-uni opened this issue Jul 26, 2024 · 1 comment
Labels
bug Something is broken

Comments

@frederik-uni
Copy link
Contributor

I cloned the latest version from the eframe template and it failed to focus the textarea. i tried to focus the input field manually with this code

if resp.clicked(){
#[cfg(target_arch = "wasm32")]
                let document = web_sys::window().unwrap().document().unwrap();
                #[cfg(target_arch = "wasm32")]
                let input = document.query_selector("input").unwrap().unwrap();
                #[cfg(target_arch = "wasm32")]
                let input_element = input.dyn_into::<web_sys::HtmlInputElement>().unwrap();
                #[cfg(target_arch = "wasm32")]
                input_element.focus().unwrap();

Which focused the textarea, but the virtual keyboard wasnt opening. I noticed that the egui.rs site does open the keyboard, but only on the second click

@frederik-uni frederik-uni added the bug Something is broken label Jul 26, 2024
@micmonay
Copy link
Contributor

Hi

I tried to fix the bug on my applications and I proposed this fix here #4855.
I don't know if it's the best solution, but it gives at least a hint for the final fix.

Best regards

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