Ionic-framework: bug: ion-popover doesn't work in ion-content

Created on 3 Oct 2014  路  11Comments  路  Source: ionic-team/ionic-framework

Type: bug

Platform: all

When using ion-popover in apps with ion-content, the popover backdrop loads but the popover is not visible. Changing the popover opacity from 0 to 1 fixes the problem.

http://codepen.io/calendee/pen/vlADg?editors=101
http://codepen.io/calendee/pen/wgrjL?editors=101

Most helpful comment

@calendee, seems to not work because you are not passing $event in the click-handler.

http://codepen.io/mhartington/pen/LgdsD

All 11 comments

I am experiencing a similar problem. Could you explain your workaround a bit more? Thank you.

@calendee, seems to not work because you are not passing $event in the click-handler.

http://codepen.io/mhartington/pen/LgdsD

So true. Sorry I missed that.

@calendee , @louislecoeur , There's another condition will trick the same bug: if you have defined an CSS class name "none" in your own, and let the "display" attribute with value "none", you will get this headache tricky bug, just like this:


.none {
  display: none;
}

why? because ionic will automatically add a "none" class in the "ion-popover-view" tag.

documentation should be updated to state that $event must be passed to the show method in order to work properly.

@phearme this is already in the docs
http://ionicframework.com/docs/api/service/$ionicPopover/

@mhartington sorry but to me, the documentation is not clear enough. It should clearly state that passing $event to the show method is mandatory. The example is not enough.

The source code says you can pass in $event or the target element. It would be useful to me to be able to pass in the target element without an event, because I am programmatically calling show on the popover, instead of doing it through an ng-click.

Here is the source code:
https://github.com/driftyco/ionic/blob/master/js/angular/service/popover.js#L1

  /**
   * @ngdoc method
   * @name ionicPopover#show
   * @description Show this popover instance.
   * @param {$event} $event The $event or target element which the popover should align
   * itself next to.
   * @returns {promise} A promise which is resolved when the popover is finished animating in.
   */

If i want to open the popover when the view loads, I can try ng-init="openPopover($event)" but $event is undefined. How can I show the popover when the view loads?

@alxvallejo did you find a solution for this ?

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.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

BilelKrichen picture BilelKrichen  路  3Comments

alan-agius4 picture alan-agius4  路  3Comments

SebastianGiro picture SebastianGiro  路  3Comments

MrBokeh picture MrBokeh  路  3Comments

brandyscarney picture brandyscarney  路  3Comments