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
687 stars 40 forks source link

fitHeight with breakpoints #241

Closed roman-rr closed 3 months ago

roman-rr commented 3 months ago

Hi @roman-rr , does the fitHeight: true feature work with breakpoints? I am trying to initialize the CupertinoPane with this configuration:

new CupertinoPane(HTMLElement, {
  draggableOver: true,
  backdrop: false,
  showDraggable: true,
  bottomClose: true,
  fastSwipeClose: true,
  buttonDestroy: false,
  fastSwipeSensivity: 0,
  fitHeight: true,
  breacks: {
    top: { enabled: true, bounce: false },
    middle: { enabled: true, bounce: false },
    bottom: { enabled: false },
  },
});

but I have 2 problems:

Is this a feature not implemented with breakpoints, or am I configuring something wrong? Thanks!

Originally posted by @lorenzodianni in https://github.com/tech-systems/panes/issues/113#issuecomment-2198612751

roman-rr commented 3 months ago

@lorenzodianni Thank you for mentions. You are right, fitHeight: true is option that doesn't support breakpoint options and other configuration about bottom/middle/top breakpoint.

Fit Height will automatically calculate size of pane (based on container height and all elements inside), and then present pane to the screen with some bottom margin (bottomOffset).

But, bottomClose: true should works fine with fitHeight: true. Here is example.

lorenzodianni commented 3 months ago

Thank you @roman-rr , for the quick response! Do you also know if bottomClose: true is supported with breakpoints or not?

Thanks!

roman-rr commented 3 months ago

@lorenzodianni Yes, bottomClose: true can be used with breakpoints to close pane when its reached bottom position.