-
Notifications
You must be signed in to change notification settings - Fork 3.1k
playground for auto sized sheets #2793
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
Comments
Thanks for the report. The requested behavior should already be available in Ionic Framework. In this case, you will want to use Here is a demo: https://codepen.io/liamdebeasi/pen/WNgogJp This feature is referred to as Custom Dialogs and is useful when you want a modal that is not full page. Can you give this a try and let me know if it works? |
@liamdebeasi Thank you for your response :) |
Whoops! You can probably stick with |
@liamdebeasi Thanks! Setting it to I think a short "receipe" for auto height sheets in the docs would be useful for others, who try to do the same. |
We already have a recipe for this: https://ionicframework.com/docs/api/modal#custom-dialogs This particular demo is using edit: Misread that, yes we should have a recipe specifically for sheets. |
Going to move this to the docs repo so we can track the documentation updates. |
Thanks for the issue! The playground was added via #2905 and will be available soon at the modal page. |
Prerequisites
Describe the Feature Request
Sheet modals that are sized according to their content. If the content exceeds the max-height, I would expect it to be scrollable. If the height of the content changes, the sheet modal should also change its height accordingly. Changing breakpoints is not possible, swiping down dismisses the sheet. It would also be nice if the height of the keyboard could be accounted for, if it is open (or just expand to max-height).
Describe the Use Case
We find ourselves more and more in situations where an auto-height sheet modal would come in very handy. For example we recently added a new payment flow in our app which makes use of different sheets for e.g. showing payment status, entering payment details, and in a lot of these cases we just wanted the sheet modal to be the size of its content. This is currently hard to do when considering different screen sizes on different devices.
A lot of native sheets behave that way too:
Describe Preferred Solution
Setting
initialBreakpoint
toauto
could be an possible option to control the feature. Setting thebreakpoints
array would not have any effect ifinitialBreakpoint
is set toauto
.Describe Alternatives
We tried to do it with custom css but it broke the sheets enter animation. Also, it would just be nice if it would be supported out of the box :)
Related Code
No response
Additional Information
No response
The text was updated successfully, but these errors were encountered: