-
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
bug: Creating a modal component without resorting to customElements #24379
Comments
Thanks for the issue. Can you try slotting your content in directly inside of <ion-modal is-open="true">
<!-- put your content here -->
</ion-modal> This should let you pass in content directly without having to use a custom element. For Ionic Angular projects, we have a utility that interfaces with Angular so you can use Angular components. Since we do not have a Svelte integration, this utility does not exist for Svelte projects. |
Hi @liamdebeasi, thank you for the suggestion. I have tried it, but there seems to be some layout issues (the content at the bottom of the modal extends below the screen, also leave animation of modal is a bit weird). I have in the mean time come across a solution which I have had to slightly adapt, but seems to work well, so I'll leave that here as an alternative:
|
Can you reproduce the layout issues in a sample app? |
I'm sure I could. I'll create a reproduction in the AM 👍 |
Thank you! |
I created a reproduction repo here: https://github.com/raymondboswel/ionic-modal-reproduction. There's a note and usage instructions in the README. Thanks 🍻 |
The sizing issue seems to be related to the margins you have applied to With the framework bindings we do this for you. Can you try that and let me know if it resolves the issue? |
Hi @liamdebeasi, that works! We can close this one out. Thanks a million 👍 |
Glad to hear this is resolved! I'll close this. Thanks for using Ionic! |
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. |
Prerequisites
Ionic Framework Version
Current Behavior
I'm currently using Ionic in a Svelte project. According to the docs, when using Ionic without one of the standard framework bindings, you ustom element. This is proving to be problematic, since my global styles / tailwind classes are not applied in the custom element.
Expected Behavior
Having used @ionic/angular in quite a few projects it definitely didn't feel like the modal components were being converted to customElements behind the scenes, so I assume there's another mechanism that can be used in addition to creating custom elements?
Steps to Reproduce
Create blank project with Svelte or just vanillaJS and use modalController in application
Code Reproduction URL
No response
Ionic Info
No response
Additional Information
No response
The text was updated successfully, but these errors were encountered: