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

uib-tooltip 'outsideClick' misbehaves with uib-datepicker-popup #6565

@evankleist

Description

@evankleist

Bug description:

We have a uib-tooltip configured with 'outsideClick' so that it closes when anything outside the tooltip is clicked. Inside of the tooltip, we have a uib-datepicker-popup so that the user can select a date for an input inside of the tooltip. When the user opens the tooltip, and then opens the datepicker, the first time they select a date, everything behaves as expected. However, the 2nd time they pick a date, the tooltip unexpectedly closes.

Link to minimally-working plunker that reproduces the issue:

https://plnkr.co/edit/H6M7C7MNPoPlWO4aNe4f

Steps to reproduce the issue:

  1. Open the plunker
  2. Click the button to open the tooltip
  3. Click the input inside of the tooltip to open the datepicker
  4. Select any date. Notice that this closes the datepicker but does not close the tooltip. This is expected because datepicker is a child node of the tooltip.
  5. Click the input inside of the tooltip to open the datepicker again
  6. Click on a different date then you initially picked

Result: Datepicker closes and tooltip closes
Expected: Datepicker to close but tooltip to remain open, just like in step 4. From my analysis so far, this is because by the time the outsideClick callback runs, the datepicker has already been removed from the dom so it is not considered a child of the tooltip, therefore it closes. I am not sure why the click in step 4 behaves differently than the click in step 6.

Version of Angular, UIBS, and Bootstrap

Angular: 1.6.1

UIBS: 2.5.0

Bootstrap: 3.3.7

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