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

Stop pane from closing #151

Closed abhishekdana1999 closed 3 years ago

abhishekdana1999 commented 3 years ago

I have an ionic app, I want the panel to be static like we can drag the pane to full screen but I don't want it to get close or dismiss when we drag it to bottom.

roman-rr commented 3 years ago

@abhishekdana1999

bottomClose: false
abhishekdana1999 commented 3 years ago

`settings: CupertinoSettings = { backdrop: false, buttonClose: false,

bottomClose: false,
breaks: {
  middle: { enabled: true, height: 550 },
},

};`

this is the setting I am using but still I am able to close it by dragging

roman-rr commented 3 years ago

@abhishekdana1999 i guess you bottom breakpoint is out of screen. Set like that:

let settings: CupertinoSettings = {
  ...
  breaks: {
    middle: { enabled: true, height: 550 },
    bottom:  {enabled: true, height: 450 }
  }
}

And let me know what happen then.

abhishekdana1999 commented 3 years ago

@roman-rr Thanks a lot I was stuck on this from morning, finally you saved me, the above solution works, can you please let me know can I change the height of the pane depending on the screen size

roman-rr commented 3 years ago

@abhishekdana1999 You can disable bottom breakpoint if you would like.

bottom:  {enabled: false}

For screen size use percents, but i guess you need device-safe area:

get deviceOffset() {
    const sab = getComputedStyle(document.documentElement).getPropertyValue("--ion-safe-area-bottom");
    return parseFloat(sab.replace('px', ''));
}
settings = {
  breaks: {
    top: { enabled: true, height: 250 + this.deviceOffset() },
  }
}
abhishekdana1999 commented 3 years ago

The above solutions works but not in my case, but no worries have fixed it by using the height of device.

I am closing this but please don't delete this as there might be chances that people need it.