wasm apps jump around when interacting #746
Replies: 2 comments 8 replies
-
I believe this is caused by this line: https://github.com/emilk/egui/blob/master/egui_web/src/lib.rs#L1206 To handle text input on mobile, an invisible text input field is moved to under the cursor (if there is a text field under the mouse). To make sure a mobile keyboard can fit, the ill-named function Basically: egui_web assumes the egui canvas takes up the full height of the screen, and so breaks for your use case. I think embedding egui into a larger html document like you do is very cool and an important use case to support, but I haven't had the time to work on it. I'm actually a bit surprised that it works at all, considering is a function Anyway, the fix should be to check whether we are in the fullscreen or embedded mode, and only move the canvas if the former. Would you have time to take a look at it? Fixing text input for the embedded use case i probably a bit more work. |
Beta Was this translation helpful? Give feedback.
-
Moving canvas to absolute position of 0 is based on the assumptions:
which is what currently happens in index.html. Based on the 3 assumptions, commenting out the lines, or |
Beta Was this translation helpful? Give feedback.
-
After migration of egui from 0.10 -> 0.14, I now have a new behavior.
Every time, I click on an app mounted to a
<canvas>
element, this element gets assignedposition: absolute; top: 0%;
and thus jumps to the top.Is there a way to prevent that?
Example: https://g-braeunlich.gitlab.io/egui_extras/widgets/index.html
Beta Was this translation helpful? Give feedback.
All reactions