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

Fix virtual keyboard on (mobile) web #4855

Merged
merged 27 commits into from
Aug 27, 2024
Merged

Conversation

micmonay
Copy link
Contributor

Hello,

I have made several corrections to stabilize the virtual keyboard on Android and IOS (Chrome and Safari).

I don't know if these corrections can have a negative impact in certain situations, but at the moment they don't cause me any problems.
I'll be happy to answer any questions you may have about these fixes.
These fixes correct several issues with the display of the virtual keyboard, particularly since update 0.28, which can be reproduced on the egui demo site.
We hope to be able to help you.

Thanks a lot for your work, I'm having a lot of fun with egui :)

@micmonay micmonay changed the title Fix virtual keyboard Fix virtual keyboard on wasm Jul 21, 2024
Comment on lines +568 to +571
if runner.text_agent.has_focus() {
runner.text_agent.set_focus(false);
runner.text_agent.set_focus(true);
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What the intention to do that? If this is some workaround it should be documented explicitly, because it could introduce unintended behaviour in other places and if such behaviour would be found and traced down to this lines is should be obvious why they are here.

Copy link
Owner

@emilk emilk left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for working on this 🙏

crates/eframe/src/web/text_agent.rs Outdated Show resolved Hide resolved
crates/eframe/src/web/text_agent.rs Outdated Show resolved Hide resolved
crates/eframe/src/web/text_agent.rs Outdated Show resolved Hide resolved
crates/eframe/src/web/mod.rs Outdated Show resolved Hide resolved
crates/eframe/src/web/mod.rs Outdated Show resolved Hide resolved
@micmonay
Copy link
Contributor Author

micmonay commented Aug 2, 2024

Hello,

I have carried out several tests of my own and they all seem to work.
Do you need me to make any other corrections or do you have any other questions?

Thanks again for your library

@emilk emilk requested review from jprochazk and removed request for Mingun August 5, 2024 07:07
@v-kat
Copy link
Contributor

v-kat commented Aug 18, 2024

@emilk do you think you could give this another review? I'm trying to hackily copy text_agent behavior into bevy in mvlabat/bevy_egui#279 and this change would help.

@emilk emilk added web Related to running Egui on the web eframe Relates to epi and eframe labels Aug 26, 2024
@emilk
Copy link
Owner

emilk commented Aug 26, 2024

@micmonay micmonay requested a review from Wumpf as a code owner August 26, 2024 14:55
@micmonay
Copy link
Contributor Author

Hello,
I think I need to create a new PR with the latest version of egui and apply the necessary corrections. Since I don't think I've done the rebase correctly, I'm not quite sure of the best way to proceed.

@emilk
Copy link
Owner

emilk commented Aug 26, 2024

You should be able to fix this branch with git rebase master -i and selecting only the relevant commits, or undo your rebase and do a merge instead

@micmonay
Copy link
Contributor Author

I think I succeeded, I'm sorry for the amount of commits and the repetition of texts... :/
I've tested the last commit, it seems OK. The script check went through.
I'm not very proficient with GIT outside the basics, but I'll do better next time.
Let me know if I need to make any other corrections.

@emilk emilk changed the title Fix virtual keyboard on wasm Improve virtual keyboard on web Aug 27, 2024
@emilk emilk changed the title Improve virtual keyboard on web Fix virtual keyboard on (mobile) web Aug 27, 2024
@emilk
Copy link
Owner

emilk commented Aug 27, 2024

I tested it again now, and on iOS Safari it now works great. Awesome work!

@emilk emilk merged commit 82814c4 into emilk:master Aug 27, 2024
20 checks passed
@micmonay micmonay deleted the fix-keyboard branch September 28, 2024 06:46
486c pushed a commit to 486c/egui that referenced this pull request Oct 9, 2024
Hello,

I have made several corrections to stabilize the virtual keyboard on
Android and IOS (Chrome and Safari).

I don't know if these corrections can have a negative impact in certain
situations, but at the moment they don't cause me any problems.
I'll be happy to answer any questions you may have about these fixes.
These fixes correct several issues with the display of the virtual
keyboard, particularly since update 0.28, which can be reproduced on the
egui demo site.
We hope to be able to help you.

Thanks a lot for your work, I'm having a lot of fun with egui :)
hacknus pushed a commit to hacknus/egui that referenced this pull request Oct 30, 2024
Hello,

I have made several corrections to stabilize the virtual keyboard on
Android and IOS (Chrome and Safari).

I don't know if these corrections can have a negative impact in certain
situations, but at the moment they don't cause me any problems.
I'll be happy to answer any questions you may have about these fixes.
These fixes correct several issues with the display of the virtual
keyboard, particularly since update 0.28, which can be reproduced on the
egui demo site.
We hope to be able to help you.

Thanks a lot for your work, I'm having a lot of fun with egui :)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
eframe Relates to epi and eframe web Related to running Egui on the web
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants