-
Notifications
You must be signed in to change notification settings - Fork 11
Dropdown Resizing #2
Comments
The core-dropdown seems to have the same issue. |
core-overlay does not seem to have the issue. could it be an issue with sizingTarget? |
It's because a dropdown is sized explicitly so it's not constrained to its parent when it's |
Is there any quick / hack fix i can do in the mean time? |
If the content of the dropdown is changing when the dropdown is closed, you can clear the dropdown's |
Setting
in itemsChanged works Except for one case: If on the first time the drop down based on dynamic content has is opened and it has no content i.e. items = [] or underfined, then the drop down well never open no matter what the content changes to. |
Any progress in solving this issue? |
Hey morethanreal, Maybe you can add the height and width reset to core-dropdown's measure function, which runs on every open:
|
There is another problem with dynamic dropdown content. "core-overlay" is watching for changes in the target (our dropdown), and once the target's content changes, core-overlay changes its display to none.
|
+1 |
vote! |
+1 |
+1 I would like to see this feature too. I'm working on a dropdown which gets populated based on results returned from an ajax call. |
The quick-fix suggested by @thisboyiscrazy worked for me: update: function() {
var self = this; // self points to the polymer input element with the dropdown attached
// update the model of your dropdown here
if (self.focused) {
setTimeout(function() {
self.$.dropdown.$.scroller.style.height = ""
self.$.dropdown.$.scroller.style.width = ""
self.$.dropdown.open();
}, redrawFix);
}
} I haven't tested this across many browsers or devices but it looks fine on Chrome 40 and Safari 8.0.3. |
This should be fixed with googlearchive/core-dropdown@921c2b8. |
Still not fixed yet! I have to follow the advice from @czellweg to trigger recalculation of |
If this is still a bug, I'm interested in getting a repro case. The successor to this component appears to be iron-dropdown, but iron-dropdown appears to resize as expected when new items are added. See http://jsbin.com/xemopu/edit?html,output. If anyone can offer a repro case with iron-dropdown or another contemporary element (paper-dropdown-menu, paper-menu-button, etc.), please post! |
From @thisboyiscrazy on November 15, 2014 15:51
I have a dropdown with content that changes based on another dropdown. The popup part of the drop down is not resizing if the content changes so I end up with a scroll bar.
Copied from original issue: Polymer/polymer#930
The text was updated successfully, but these errors were encountered: