question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

feat: sheet modal programmatically move to a breakpoint

See original GitHub issue

Prequisites

Describe the Feature Request

I have some feature requests for the new v6 Sheet Modal that all kinda belongs to each other:

Auto calculated height

It would be great to make the modal have the height of the content, not more, not less. The library we are currently using (https://github.com/roman-rr/cupertino-pane) has such an option.

Disable Drag Gesture

It would be great do be able to dynamically enable/disable the Drag Gesture

Manual move to Breakpoint

It would be great to be able to have a method on the modal like moveToBreakpoint(), where i can dynamically move to a breakpoint.

Describe the Use Case

These three requests should work all together, image the following use case:

I want to show a Sheet Modal that has only a checkbox and a button below. This should have the height of the content (Request No 1). Dragging on this Sheet should be disabled (Request No 2). If the users selects (or unselects) the checkbox some more content will be shown. After that i want to dynamically move the Breakpoint (Request No 3). Also this moveToBreakpoint() method should of course accept numbers for the breakpoint, but also accepts something like 'auto' to adjust the height on the current content (which changes with the checkbox)

I hope i described it understandable 😃

Describe Preferred Solution

No response

Describe Alternatives

No response

Related Code

No response

Additional Information

No response

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Reactions:15
  • Comments:20 (13 by maintainers)

github_iconTop GitHub Comments

4reactions
EinfachHanscommented, Jan 27, 2022

I created a PR which activates the possibility to do this: #24648

4reactions
liamdebeasicommented, Sep 22, 2021

We have plans to implement a canDismiss feature for ion-modal which should cover the use cases described here (I.e. not allowing dismiss until a user checkbox a box on the modal). This is being tracked on https://github.com/ionic-team/ionic-framework/issues/22297.

In terms of resizing the modal to fit the height, I am not sure that API is a good fit for Ionic since we already expose a --height CSS Variable that you can use to adjust the height of the modal dynamically.

Being able to programmatically move to a certain breakpoint seems useful, so I can mark that as a feature request. Any updates regarding that feature will be posted on this thread. Thanks!

Read more comments on GitHub >

github_iconTop Results From Across the Web

5 Examples of the new Ionic 6 Bottom Sheet Modal
How can I programmatically “navigate” to a specific breakpoint? Is there any method or does present() supports a { breakpoint: number } param?...
Read more >
Einfach Hans (@einfach_hans_) / Twitter
feat (modal): add ability to programmatically set current sheet breakpoint by EinfachHans · Pull... Pull request checklist Please check if your PR fulfills...
Read more >
5 Examples of the new Ionic 6 Bottom Sheet Modal
The breakpoints value is an array of values between 0 and 1, and defines at which percentage of your screen the modal snaps...
Read more >
Grid template areas - CSS: Cascading Style Sheets | MDN
.header { grid-area: hd; } .footer { grid-area: ft; } ... part of the CSS, this makes it very easy to make changes...
Read more >
Close modal bottom sheet programmatically in flutter
Closing a ModalBottomSheet programmatically is done via. Navigator.pop(context);. So I just call that pop function inside the onTap callback ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found