tech-systems / panes

🎉📱 Create dynamic modals, cards, panes for your applications in few steps. One instance – Thousands solutions. Any framework and free.
https://panejs.com
MIT License
681 stars 40 forks source link

[BUG] keyboard cause pane created at wrong position #245

Open henryyuuu opened 2 weeks ago

henryyuuu commented 2 weeks ago

In my use case, there's an input field for user to type some text with keyboard. After user click search button on keyboard, a new pane will be created immediately, and the keyboard will close at the same time. however, it seems that the bottom of the pane will be in the middle of the screen, which is the top position of the keyboard which is already closed. Instead of create the pane with a small delay, is there any better way to re-calculate the position of the pane? Thanks very much!

roman-rr commented 2 weeks ago

Hello @henryyuuu ! This is definitely not proper behavior, and I guess this is some cross-framework issue. Could you please provide more information, such as: framework you are using, and version of package. Perfect, if you can create a dummy repo that will introduce the issue, or at least capture some video.

henryyuuu commented 2 weeks ago

after some tests and tracing the code, i found that this bug is cause by present method's updateScreenHeights gets wrong window.innerHeight. In my case, when the keyboard is open, the window.innerHeight is 398, when the keyboard is hidden, the window.innerHeight is 628. However, even i manually call updateScreenHeights after the keyboard is hidden, the pane is still in wrong position.

roman-rr commented 2 weeks ago

@henryyuuu Thank you. Are you able to share code or repo, so I can easy and fastly debug it?

henryyuuu commented 2 weeks ago

The code i mentioned above is here. Sorry i cannot provide my code due to some privacy issue. I solution to this problem is extending CupertinoPane and override the updateScreenHeights method to make it possible to get the window height without affect by keyboard showing or not.

roman-rr commented 2 weeks ago

@henryyuuu