-
Notifications
You must be signed in to change notification settings - Fork 13.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: sheet modal programmatically move to a breakpoint #23917
Comments
Can you provide a code example of how this currently works using the Cupertino pane? |
See here: There is the option fitHeight |
Sorry, my last comment was confusing. What I was asking for is a code example of how this is working with regards to your use case. I am interested in seeing how you are applying the features from Cupertino Pane to address the use case that you have. |
I create the pane with
It offers a function |
I can see the value in programmatically moving the sheet to a certain breakpoint, but what is the use case here for disabling dragging on the sheet modal? The sheet is designed to be dragged/swiped, and disabling that breaks the primary usage of the sheet. Also what is the use case for |
As described i want to have the Sheet have a height to fit the content. After the content changes Disabling the Drag would be for this use case as well as the sheet should only have one breakpoint (the auto height one) so dragging it down or up shouldn't be possible |
Can you provide an example of the sheet height changing? I have not seen this used in native apps. (Screenshots of an app would be really helpful!)
Maybe I am misunderstanding the use case, but this sounds like a regular modal with a custom height/styles? |
I agree, disabling dragging (and also dismissing by dragging it down) the sheet modal would be a welcome addition. |
I don't know if i have seen this in a native app, but i bet it's possible somehow 😃🤔 Yeah i use case is like @DavidStrausz described. Of course a normal Modal would work here too, but it should be a Sheet Modal (including handle etc) |
We have plans to implement a 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 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! |
I am trying to implement a sheet modal as a footer toolbar with an edge so on |
Any news on programmatically moving to breakpoints? Hopefully that would include the ability to get the current breakpoint as well. |
Bumping for news on programmatically moving to breakpoints? I have a few more related features I'd like to see too:
The library we are currently using (https://github.com/arielfaur/ionic-pullup) has these features but it requires a lot of work-arounds and code duplication, we would love to be able to migrate to a simple, bundled component. |
I created a PR which activates the possibility to do this: #24648 |
I'm facing a use case where I need to change programmatically the modal breakpoint. This feature would be very useful. |
I would love to see those features as well. Until then, I'm using this method to get breakpoints at 120px, 290px, and 100%. It's not great but it get's the job done for now.
|
Beside the feature to move to a breakpoint programmatically, it would be also great, if there is some method, to listen to breakpoint changes. Example: I want to show an element e, if I reach the breakpoint b. |
@MartinR2295 my PR adds also two methods: |
Thanks for the issue. This has been resolved via #24648, and this feature will be available in an upcoming release of Ionic Framework. |
Thanks for the issue! This issue is being locked to prevent comments that are not relevant to the original issue. If this is still an issue with the latest version of Ionic, please create a new issue and ensure the template is fully filled out. |
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
The text was updated successfully, but these errors were encountered: