Open nashaofu opened 5 months ago
I think that is the default behavior for iOS. You may need to change your page height according to the visualViewport.height
I think VisualViewPort is no effect.
When the keyboard is not popped up, the window.innerHeight is 776,This is the window size when the keyboard pops up:
The following is the effect of using VisualViewPort. VisualViewPort events will be delayed, so the effect is very bad. I think it's still necessary to change the height of the container.
const appBarRef = useRef<HTMLElement>(null);
useEffect(() => {
const onVisualViewportChange = () => {
const offsetTop = window.visualViewport?.offsetTop;
if (appBarRef.current) {
appBarRef.current.style.transform = `translateY(${offsetTop}px)`;
}
};
window.visualViewport?.addEventListener('scroll', onVisualViewportChange);
window.visualViewport?.addEventListener('resize', onVisualViewportChange);
return () => {
window.visualViewport?.removeEventListener(
'scroll',
onVisualViewportChange,
);
window.visualViewport?.removeEventListener(
'resize',
onVisualViewportChange,
);
};
}, []);
https://github.com/tauri-apps/tauri/assets/19303058/f1d2d444-3d8a-466a-a4aa-987cf831a814
Does anyone follow up with this question?
Same problem on Android — the visualViewport
height is incorrect and it rarely functions as expected.
Is anyone looking into this? I'm trying to make my app work on ios and this issue is a real problem
Describe the bug
IOS pop-up keyboard causes webview to move outside the screen
Reproduction
Place an input element on the page, click on the element, and wake up the keyboard
Expected behavior
The webview height changes to screen height minus keyboard height
Full
tauri info
outputStack trace
No response
Additional context
https://github.com/tauri-apps/tauri/assets/19303058/5cf1b708-9d20-466d-a6f1-9af9951fe8fe
No response