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

Popover closes unexpectedly #5347

Closed
BartoGabriel opened this issue Jan 26, 2016 · 8 comments
Closed

Popover closes unexpectedly #5347

BartoGabriel opened this issue Jan 26, 2016 · 8 comments

Comments

@BartoGabriel
Copy link

Example:
http://plnkr.co/edit/dMWd7KRHjaoOZWXyYvE5?p=preview

  1. When I click on "today" the popover closes unexpectedly.
  2. When I select a date the calendar closes, again I select a new date in the same calendar and closes unexpectedly the popover. This happens when I select twice dates in the same calendar.

Reference: #5305 (comment)

@icfantv
Copy link
Contributor

icfantv commented Jan 26, 2016

@BartoGabriel, please do not use the issues forum for support-related requests. Rather, please follow the instructions here as support-related questions are best served by and for the community. The issues forum is reserved for bugs. Thanks.

The problem is that you are using a datepicker inside a popover and you've specified outsideTrigger as the close trigger, which is happening when you click on the datepicker since it's outside the popover. Your best bet is to use none and then use the popover-is-open property to manually close it based on the datepicker popup's is-open property.

@BartoGabriel
Copy link
Author

@icfantv It is not normal behavior. For example if you select the date from 01/03/2016 three times, the component is closed.
Why it is closed at the third time and not in the first?

@icfantv
Copy link
Contributor

icfantv commented Jan 26, 2016

While I agree that this is not normal behavior, it does not change the fact that you're not using the combination of the two correctly. Because of this latter statement, I'm not sure it makes any sense for the developers to spend time investigating why this is occurring. Investigation into issues can be quite time consuming and we would like to reserve it for issues that are more clearly library bugs.

I'm happy to reopen this but it's probably going to be a very low priority. What are your thoughts?

@icfantv
Copy link
Contributor

icfantv commented Jan 26, 2016

I spoke with the dev team and we think we believe we have a relatively easy fix which would involve stopping event propagation on the buttons in the datepicker so that events don't leak out from the component (making it isolated).

That said, you still want to change your trigger on the popover because even if we do that, you're still going to run into issues with the buttons that lie outside the popover boundaries.

@icfantv
Copy link
Contributor

icfantv commented Jan 26, 2016

This is looking like a pretty big change since nearly all the templates will need to change as well as the datepicker code as well. This is not trivial.

@BartoGabriel
Copy link
Author

I agree that the priority should be low, and the error is not urgent. I do not think it worthwhile to make many changes just for this error.

On the other hand, it does not take into account the limits of the popover as you say. For example, if you click on the June 2, it has the same behavior as clicking on a date which is within the borders of popover.
Always closed to select a date consegutiva third time.

@wesleycho
Copy link
Contributor

I'm going to schedule this for 1.2 - I think this is pretty important to fix, but one can temporarily fix this by wrapping the datepicker usage like this

<div ng-click="$event.stopPropagation()">
  <input uib-datepicker-popup ng-model="foo">
</div>

@wesleycho wesleycho added this to the 1.2.0 milestone Jan 26, 2016
@BartoGabriel
Copy link
Author

@wesleycho thank you very much.

Following the example in case anyone ever need with the current version.
http://plnkr.co/edit/V5lzRCMUJCBerTzQ18pU?p=preview

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

Successfully merging a pull request may close this issue.

3 participants