Skip to content
This repository was archived by the owner on May 29, 2019. It is now read-only.

Popover with custom template doesn't auto close when clicking outside #3855

Closed
yaring opened this issue Jun 25, 2015 · 10 comments
Closed

Popover with custom template doesn't auto close when clicking outside #3855

yaring opened this issue Jun 25, 2015 · 10 comments

Comments

@yaring
Copy link

yaring commented Jun 25, 2015

https://angular-ui.github.io/bootstrap/#/popover

There is option popover-trigger="focus" which closes the popover on any click inside or outside the popover, this behaviour seems to be wrong when using custom template with inputs for example.

Please look on angular-strap example, and the third (red one):
http://mgcrea.github.io/angular-strap/#/popovers
Over there after open the popover when click inside the popover nothing happens as it should be, but when you clicking outside it disappears.
Maybe related: mgcrea/angular-strap#1076

I can't find and similar behaviour on ui-select popover.

Plnkr:
http://plnkr.co/edit/iJJ3LCpWR675dUU0Rl5R?p=preview

@yaring yaring closed this as completed Jun 25, 2015
@yaring yaring reopened this Jun 25, 2015
@yaring yaring changed the title Popover doesn't auto close when clicking outside Popover with custom template doesn't auto close when clicking outside Jun 25, 2015
@austinpray
Copy link

Yep seeing this as well.

@yaring
Copy link
Author

yaring commented Jul 5, 2015

I've added plnkr which demonstrates focus trigger, try clicking on the input after opening the custom template popover.

@icfantv
Copy link
Contributor

icfantv commented Aug 3, 2015

@yaring @austinpray, the trigger is not on the popover, but on the element on which the popover directive is placed. Thus, when you click on the popover template, the popover element is losing focus and the popover closes.

The default trigger for popovers is click. You can see this via the UI Bootstrap Example - Look at the Popover With Template button example. You will see that the popover will not close unless the Popover With Template button is clicked again.

@wesleycho, I think we can close this.

@wesleycho
Copy link
Contributor

As pointed out, one has to set the popover trigger to be focus, so that on blur it will close.

@yaring
Copy link
Author

yaring commented Aug 3, 2015

@icfantv @wesleycho , the problem with the click trigger is that it's not closes the popover when clicking outside but only clicking on the Popover With Template button.

As I showed on angular-strap it's closing it when clicking outside of the popover.

@wesleycho
Copy link
Contributor

One could potentially customize the click trigger, but automatically changing the click trigger to close on outside click would be a poor breaking change since it changes expectations in behavior.

This perhaps requires some more thought on how best to support this.

@kikar
Copy link

kikar commented Aug 13, 2015

I have the same problem, I need a popover with an input field, but that it closed when clicking outside of the popover and not again on the button that activates it.
Is there any progress on this? Any suggestion on how could I make it?

@LeleDev
Copy link

LeleDev commented Aug 21, 2015

@kikar Same here

@icfantv
Copy link
Contributor

icfantv commented Aug 27, 2015

With the fix for #590 in place, you guys can now programmatically control when the tooltip is open and closed via the tooltip-is-open option (popover-is-open option for popovers). Note that this change is in 0.13.4-SNAPSHOT and not in 0.13.3. We should be releasing 0.13.4 shortly.

@icfantv icfantv closed this as completed Aug 27, 2015
@pr-dev-repo
Copy link

@kikar @LeleDev Can you please share if you found? i am having trouble with this. thanks

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

8 participants