-
Notifications
You must be signed in to change notification settings - Fork 15
Unable to specify height of the scroller. #13
Description
When using paper-dropdown..
Due to the code that is calculating the size of the dropdown, it always seems to come out with a size of the scroller at 304px. Need to be able to specfify an overriding value for the scroller/dropdown size, I have only 8 items in the list but not all are visible when there is plenty of vertical space.
I am using the code below, the target of the core-dropdown at expansion is some animation...
<paper-dropdown id="machinesDropdown" class="dropdown" layered>
<core-menu id="machinesDropdownMenu" class="menu" selectedItem="{{selectedMachineTypeItem}}" selected="{{machinetype}}" valueattr="id" >
<template repeat="{{machinetype in machinetypes}}">
<paper-item id="{{machinetype.id}}" class="listitem" >
<div class="listitem">{{machinetype.type}}</listitem>
</paper-item>
</template>
</core-menu>
</paper-dropdown>
setting the height of the scroller by css, or code is always overwritten by the following in core-dropdown's positionTarget method.
// explicitly set width/height, because we don't want it constrained
// to the offsetParent
var target = this.sizingTarget;
var rect = this.measure();
target.style.width = Math.ceil(rect.width) + 'px';
target.style.height = Math.ceil(rect.height) + 'px';
I would suggest an attribute that allows overriding this width and height, with either removing the width/height style which means the scroller will size to its contents, or allowing some other method to ensure all the contents are visible when there is screen real estate to show it.