File tree Expand file tree Collapse file tree 1 file changed +15
-3
lines changed
Expand file tree Collapse file tree 1 file changed +15
-3
lines changed Original file line number Diff line number Diff line change @@ -9,13 +9,25 @@ export const useKeyboardResize = () => {
99
1010 const handleVisualViewportChange = ( ) => {
1111 clearTimeout ( timeoutId ) ;
12+
1213 timeoutId = setTimeout ( ( ) => {
1314 if ( window . visualViewport ) {
1415 const isKeyboardVisible = window . visualViewport . height < window . innerHeight ;
16+ const newKeyboardHeight = isKeyboardVisible
17+ ? window . innerHeight - window . visualViewport . height
18+ : 0 ;
19+
20+ if ( isKeyboardVisible && newKeyboardHeight === 0 ) {
21+ setTimeout ( ( ) => {
22+ if ( window . visualViewport ) {
23+ setKeyboardHeight ( window . innerHeight - window . visualViewport . height ) ;
24+ }
25+ } , 300 ) ;
26+ } else {
27+ setKeyboardHeight ( newKeyboardHeight ) ;
28+ }
29+
1530 setKeyboardVisible ( isKeyboardVisible ) ;
16- setKeyboardHeight (
17- isKeyboardVisible ? window . innerHeight - window . visualViewport . height : 0 ,
18- ) ;
1931 }
2032 } , 100 ) ;
2133 } ;
You can’t perform that action at this time.
0 commit comments