Skip to content

Modal backdrop always hidden and z-index bug #10224

@EmmanuelFRANCOIS

Description

@EmmanuelFRANCOIS

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:
When presenting a component through modalcontroller, the backdrop is always hidden whatever showBackdrop is set to true or false.

Expected behavior:
When showBackdrop is set to true (default value), backdrop should be visible and behind the modal component.

Steps to reproduce:
(followed Ionic 2 API documentation ModalController example)

import { ModalController, ViewController } from 'ionic-angular';
import { CmpModal } from '../../components/cmpModal/cmpModal';
...
presentCmpModal() {
let opts: any = {
  showBackdrop: true,
  enableBackdropDismiss: true
}
let cmpModal = this.modalCtrl.create( CmpModal, null, opts );
cmpModal.onDidDismiss(data => { console.log(data); });
cmpModal.present();
}

The problem seems to come from css:

@media not all and (min-height: 600px) and (min-width: 768px)
ion-modal ion-backdrop {
    visibility: hidden;
}

When deactivating "visibility: hidden" line in chrome, backdrop becomes visible.
However, the CmpModal component is placed BEHIND backdrop, so it is not reachable for action...

Other information:
Cordova CLI: 6.1.1
Ionic Framework Version: 2.0.0
Ionic CLI Version: 2.2.1
Ionic App Lib Version: 2.2.0
Ionic App Scripts Version: 1.0.0
ios-deploy version: Not installed
ios-sim version: Not installed
OS: Windows 7
Node Version: v6.9.0
Xcode version: Not installed

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions