Ion-toggle on Samsung Internet Browser - toggle relies on contain:strict


Anyone have a hint why toggles appear “stretched” in the Samsung Internet Browser (version 5.4.00-75) on android?

This is how the same slide displays in Chrome on Android:

        <h5>{{'WEBSHOP_SUMMARY_BEFORE_PAYMENT'| translate}}</h5>
          <ion-item (click)="presentTermsPopover()">
            <ion-label [innerHTML]="'WEBSHOP_ACCEPT_TERMS' | translate"></ion-label>
            <ion-toggle [(ngModel)]="acceptTerms"></ion-toggle>
            <ion-label>{{'WEBSHOP_ACCEPT_NEWSLETTER' | translate}}</ion-label>
            <ion-toggle [(ngModel)]="acceptNewsletter"></ion-toggle>



Sadly, the embedded webviews are all slightly different on Android. Two options, you could embed Crosswalk to standardize the browser. It will increase your APK size and the project is no longer active. Or you could attempt to see what is failing in the CSS and fix it locally or submit a PR to Ionic. I would make sure that you validate the issue on a basic Ionic template and it is not the result of some custom CSS that you might have applied.

Good luck


Well we’ve narrowed it down to

.toggle-wp {
position: relative;
width: 40px;
height: 18px;
box-sizing: content-box;
/* contain: strict; */

The contain:strict here is necessary otherwise you get the effect I showed above even in the Chrome Browser on android.
But contain:strict is not known in Webkit so…

Any tips appreciated…


More interesting to me is that -wp styles are being applied rather than -md styles.

I would open an issue on the repo on this



We’re using Windows styles intentionally: in app.module.ts:

imports: [
IonicModule.forRoot(MyApp, {
mode: ‘wp’


Switching to md we get:

.toggle-md {
position: relative;
padding: 12px;
width: 36px;
height: 14px;
box-sizing: content-box;
/* contain: strict; */

Also contains “contain:strict” which again does not work in Webkit