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

Datepicker doesn't work inside of a dropdown #4197

Closed
danbrouwer opened this issue Aug 12, 2015 · 8 comments
Closed

Datepicker doesn't work inside of a dropdown #4197

danbrouwer opened this issue Aug 12, 2015 · 8 comments

Comments

@danbrouwer
Copy link

Dropdowns do not function properly when they contain datepickers. I created a plunker to demonstrate this issue:
http://plnkr.co/edit/4oKkCBE1guidfamYYp7S?p=preview

Open the button dropdown
Open the datepicker dropdown and click a date
Close the button dropdown
Try to open the button dropdown again
Observe that the dropdown does not open properly

Debugging has led me to believe that the datepicker popup is setting the dropdownMenuTemplateUrl property on the dropdownController for the outer dropdown.

This appears to be a regression in 0.13.x, as changing the ui-bootstrap version back to 0.12.1 fixes this issue.

@wesleycho
Copy link
Contributor

This seems like a very bad UX - any particular reason for putting a datepicker popup inside a dropdown?

This does appear to be a bug, but this is also a UX decision that should be heavily frowned upon. If you are willing to file a PR with a good fix for this, I would be happy to review & get it in, but otherwise this is ranks very low on the list of things to address.

@danbrouwer
Copy link
Author

We're using the dropdown to contain a collection of filters for a table. It's nice in that the filters only take up screen real estate when the user is interacting with them.

@sullivanpt
Copy link
Contributor

FYI: setting datepicker-append-to-body="true" will bypass this issue; however, the append to body option does not handle Z-order well if your date picker is in a modal.

sullivanpt added a commit to sullivanpt/bootstrap that referenced this issue Sep 29, 2015
A dropdown-menu can be nested within a parent dropdown without
adversely affecting the parent, if the child dopdown-menu element
also has the dropdown-nested attribute defined.

Closes angular-ui#4197
@chrisirhc
Copy link
Contributor

Hmm.. wasn't the resolution from before to stop supporting using classes for directives? That's a breaking change. Also, this will no longer be an issue once we use prefixes.
However, I think we should still stop supporting class-based directives. dropdownMenu is the only directive with restrict: 'AC'.

@sullivanpt
Copy link
Contributor

I don't have any opinion on class based directives. The issue here is that the drop down controller used for menu dropdowns is the same as the drop down controller used for the date picker; so when a date picker is nested inside a drop down angular picks the wrong drop controller to attach to the date picker. It is really a problem with the angular 'require' statement, but I could not think of any easy to fix it other than either the hack I put in my pull request, or refactoring the date picker to use its own drop down controller 'name'. Open to suggestions, but do need a solution. We use very large do drop downs for setting search filters, including dates.

@wesleycho
Copy link
Contributor

Interesting - I'll schedule this for the upcoming 0.14.0 release and we'll have a fix in. That is great investigative work there @sullivanpt, thanks for looking into this.

@danbrouwer
Copy link
Author

I'm not sure this is fixed. Changing the angular-bootstrap version to 0.14.0, 0.14.1, or 0.14.2 in that plunkr still results in the same behavior. Am I missing something?

@icfantv
Copy link
Contributor

icfantv commented Oct 22, 2015

@djasper99, please do not comment on old and closed issues. Doing so is a good way for us to miss stuff.

If you think you've found a bug, please follow these instructions.

Unfortunately, if you think you have found a bug and do not follow the above instructions within a reasonable amount of time, we will close the issue due to lack of activity.

sullivanpt added a commit to sullivanpt/bootstrap that referenced this issue Oct 22, 2015
Extends the fix from commit c5fe8b to the deprecated
non uib dropdown-menu.

Closes angular-ui#4197
icfantv pushed a commit that referenced this issue Oct 22, 2015
* Extend fix from commit c5fe8b to the deprecated
non uib-dropdown-menu.

Fixes #4197
Closes #4693
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.

5 participants