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] setBreakpoints now adjusts beyond the height of the screen #181

Closed CodeWithOz closed 2 years ago

CodeWithOz commented 2 years ago

Describe the bug A clear and concise description of what the bug is. Calling .setBreakpoints({ middle: { enabled: true, height: 400 } }) on a device whose window.innerHeight is 568 causes the pane to be adjusted beyond the height of the device. And repeating this causes the height to continue rising. This was not happening as of commit #ce86b63, but the current latest commit #2436337 has the bug

To Reproduce Steps to reproduce the behavior:

  1. Go to this build and download the APK
  2. Install it and click on "Init Pane", followed by "Set mid breakpoint". You will notice that the pane's height grows by ~400 pixels. If your device is big enough you will still be able to click the "Set mid breakpoint" button again. Every time you click it, the height grows by ~400px to the point that it exceeds the height of the screen.
  3. Swipe down to dismiss the sheet

Expected behavior .setBreakpoints({ middle: { enabled: true, height: 400 } }) should set the height of the breakpoint to 400px instead of increasing the height of the pane by 400px.

Screenshots See this attached video.

https://user-images.githubusercontent.com/28525986/172643958-e2ae6aab-5a45-48f7-9d2d-1eb59b7e8c84.mp4

Desktop (please complete the following information):

Smartphone (please complete the following information):

Additional context Add any other context about the problem here.

roman-rr commented 2 years ago

@CodeWithOz Thank you, yes did not test all cases. will check and fix

roman-rr commented 2 years ago

@CodeWithOz should be fixed and available with 1.2.91

CodeWithOz commented 2 years ago

@roman-rr Nice! Please update the "releases" section of this repo so that the latest versions are shown there. I didn't know you had released new versions because that number hasn't changed, but I just checked npm and can see there's already 1.2.92.

roman-rr commented 2 years ago

@CodeWithOz In 1-2 days will be released major 1.3.0 with changelogs and releases section. 1.2.92 just a minor tag version.

CodeWithOz commented 2 years ago

@roman-rr okay thanks :+1: . I tried the new 1.2.92 in my real app and this problem isn't fully fixed. It's still moving a lot before finally settling on the updated breakpoint height. I don't have a reproduction in a sample app right now but if you have other ways to test the fix then it may be worth doing so.