Skip to content
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: Black backdrop of Modal triggered from ActionSheet #5483

Closed
mensch opened this issue Feb 17, 2016 · 4 comments
Closed

bug: Black backdrop of Modal triggered from ActionSheet #5483

mensch opened this issue Feb 17, 2016 · 4 comments
Assignees
Milestone

Comments

@mensch
Copy link

mensch commented Feb 17, 2016

Type: bug

Ionic Version: 2.x

Platform: all

I'm experiencing an issue when triggering a Modal from a method in an ActionSheet. When the animation of the modal occurs the list view I expected to see is obscured by an opaque black div. It appears the ion-page from where the ActionSheet is triggered gets a hidden attribute as soon as the animation of the Modal starts. Dismissing the Modal works correctly, the underlying list view is visible when the Modal is animating.

Not sure how to provide a CodePen for this, so I've posted the relevant code below.

This is the Modal:

import {Page, Modal, NavController, ViewController} from 'ionic/ionic';

@Page({
  templateUrl: 'build/pages/modals/comment/comment.html'
})
export class CommentModal {
  constructor(nav: NavController, viewCtrl: ViewController){
    this.nav = nav;
    this.viewCtrl = viewCtrl;
    this.comment = { content : '' };
  }

  closeModal() {
    this.viewCtrl.dismiss();
  }

  showModal() {
    let modal = Modal.create(CommentModal);
    this.nav.present(modal);
  }
}

This is the Page where the ActionSheet is triggered:

import {Page, NavController, NavParams, ActionSheet} from 'ionic/ionic';
import {DataService} from '../../services/data';
import {TimeAgoPipe} from 'angular2-moment';
import {CommentModal} from '../modals/comment/comment';

@Page({
  templateUrl: 'build/pages/post/post.html',
  pipes: [TimeAgoPipe],
  providers: [DataService, CommentModal]
})
export class Post {
  constructor(nav: NavController, navParams: NavParams, data: DataService, commentModal: CommentModal) {
    this.nav = nav;
    this.commentModal = commentModal;
    this.post = navParams.get('post');
    this.comment = {
      content : ''
    };

    data.getData('comments',{
      post : this.post.id,
      per_page : 30,
      order : 'DESC',
      orderby : 'date'
    }).subscribe(response => this.comments = response);
  }

  saveComment() {
  }

  openCommentSettings(content) {
    let actionSheet = ActionSheet.create({
      buttons: [
        {
          text: 'Delete comment',
          style: 'destructive',
          handler: () => {
            console.log('Destructive clicked');
          }
        },{
          text: 'Edit comment',
          handler: () => {
            this.commentModal.showModal(content);
          }
        },{
          text: 'Cancel',
          style: 'cancel',
          handler: () => {
            console.log('Cancel clicked');
          }
        }
      ]
    });
    this.nav.present(actionSheet);
  }
}
@Ionitron Ionitron added the v2 label Feb 17, 2016
@adamdbradley
Copy link
Contributor

Sorry but I'm not really following, would you be able to explain further and provide a minimal test case that replicates this issue?

@adamdbradley adamdbradley self-assigned this Feb 17, 2016
@mensch
Copy link
Author

mensch commented Feb 17, 2016

I was afraid you'd say that. ;-)

This animated gif demonstrates the behaviour, it seems related to this report #5430.

app

I'll see if I can provide a working example later.

@mensch
Copy link
Author

mensch commented Feb 17, 2016

A simple test app demonstrating the issue can be downloaded here. After some further testing the issue seems to vary from browser to browser. In Chrome (which I use for testing) the modal is visible, but in Safari and Firefox I only see a black div. If necessary I can try in the iOS emulator as well.

@adamdbradley
Copy link
Contributor

Awesome, thanks for example and creating the issue, this was a good find! Should be fixed now and will be in the next release, thanks!

@ionitron-bot ionitron-bot bot locked and limited conversation to collaborators Sep 7, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants