Git Product home page Git Product logo

Comments (4)

Saqib92 avatar Saqib92 commented on April 30, 2024 1

As per documentation this is intended result.
The mode determines which platform styles to use.

remove mode from router-outliet and it will work as intended.

from ionic-framework.

Jesspu avatar Jesspu commented on April 30, 2024

Maybe I didn't explain the issue well enough.

It is only applying the mode set on the ion-router-outlet to conditionally rendered components (things rendered inside an @if,*ngIf,@for,*ngFor...). Not all the components.

So the expected behavior is that it would either

  1. apply the mode set on the ion-router-outlet to all components, or
  2. none and only the ion-router-outlet itself.

Example.

If the md mode is set on the ion-router-outlet, and you have two ion-selects. One ion-select is inside an *ngIf directive and you are running your app on an iphone. The ion-select NOT in the *ngIf will be using mode ios, the one inside the *ngIf will be using mode md. I replicated this in the repo attached to the issue.

from ionic-framework.

Jesspu avatar Jesspu commented on April 30, 2024

Any updates on this?

from ionic-framework.

liamdebeasi avatar liamdebeasi commented on April 30, 2024

Apologies for the delay. I can confirm that this is fixed in Ionic 8.


In previous versions of Ionic, your page component was initially mounted as a sibling of ion-router-outlet and was later moved to be a child of it. When the page component is initially mounted, Ionic does not consider the mode set on the RouterOutlet (since it's not an ancestor at the time) when trying to determine the Item's mode.

By the time the delayed Item in your demo was added, the page component had already been moved to be a child of the RouterOutlet, so now Ionic does consider the mode set on that component.

In Ionic 8 we fixed this so the page component is always mounted as a child of the RouterOutlet initially, so no moving is needed.

from ionic-framework.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.