-
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
Nesting multiple <ion-content> with <ion-slides> #10258
Comments
Hello, thanks for opening an issue with us! You shouldnt actually be using multiple |
Thanks for the feedback. For reference, I still think this can be a valid usage of |
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. |
Ionic version: (check one with "x")
[ ] 1.x
[x] 2.x
I'm submitting a ... (check one with "x")
[x] bug report
[ ] feature request
[ ] support request => Please do not submit support requests here, use one of these channels: https://forum.ionicframework.com/ or http://ionicworldwide.herokuapp.com/
Current behavior:
I am using
<ion-slides>
to display a wizard-like set of components on a single page. The app goes to the slider page and the user will go through different slides on the page. The slides contain forms and inputs, and scroll assist was not working.I don't believe this usage of
<ion-slides>
was intended, but I've seen a few other developers use it this way. The advantage is that for long wizards/workflows, there is an option to dismiss the entire page, rather than going back through a stack of several pages. Additionally, it cuts down on the issue of having multiple pages in your navigation stack that you must pass information to. It's possible withNavParams
, but it's much simpler to use components in each slide and bind data directly to them. There's no documentation for how to "correctly" do this sort of UX, but I've got a working theory.First, the slides must be
ion-fixed
, and each individual slide should have its own<ion-content>
. This causes scroll assist to work correctly on individual slides when focusing an input. However, nesting<ion-content>
s was never an intended feature, and each child content overrides theViewController
's setContent
. This becomes a problem when using iOS transitions.Bug:
Expected behavior:
Steps to reproduce:
Create and push a page with multiple
<ion-content>
using iOS transitions.Related code:
Here's a sample page setup to push:
Here is the utility function I'm using right now to patch
ViewController
. If other developers are running into this issue, feel free to use this as a workaround. With this patch, I get the expected output GIF above.I believe the best solution would be modifying
Content
's constructor.Questions / Discussion
There are a couple other ways to go about it, and I'd like to open this issue as a discussion. This could be considered a new feature in addition to a bug fix.
Are there other developers out there that see this as a valid UX use case?
Is it useful enough to add documentation to
<ion-slides>
to highlight this possible feature?Is there a better way to create a wizard/workflow solution?
Ionic info: (run
ionic info
from a terminal/cmd prompt and paste output below):The text was updated successfully, but these errors were encountered: