Polymer paper-dropdown-menu not resized when dynamically add/remove elements to it

137 views
Skip to first unread message

Xiao Cao

unread,
Jun 18, 2015, 11:47:50 AM6/18/15
to w...@dartlang.org

Hi everyone


I met an UI problem when developing website with dart polymer. I have the following paper-dropdown-menu code


<paper-dropdown-menu>

 <paper-dropdown>

   <core-menu>

     <template repeat="{{enumerator in enumeratorList}}">

       <paper-item name="{{enumerator}}"> {{enumerator}} </paper-item>

     </template>

   </core-menu>

 </paper-dropdown>

</paper-dropdown-menu>


, where enumeratorList is an observable list defined in dart. 


Here is the problem, If I toggle the dropdown menu first,  add several elements to the enumeratorList dynamically through dart, and at last open the dropdown menu again, the dropdown would have a wrong display. It would be like this




If I don't toggle the dropdown menu at first, the dropdown menu display would be correct, like this



It seems to me that the dropdown menu can not dynamically detect added/removed paper-item content. I went through the dart APIs of all these element paper-dropdown-menu, paper-dropdown and core-menu but didn't see any method called resize or update. Anyone has ideas how to fix the problem?


Thanks very much!!!

Günter Zöchbauer

unread,
Jun 18, 2015, 12:32:18 PM6/18/15
to w...@dartlang.org

Günter Zöchbauer

unread,
Jun 18, 2015, 12:36:10 PM6/18/15
to w...@dartlang.org
It seems here a `sizingTarget` was added but I couldn't find it in the docs. 
Setting `paper-dropdown`s `sizingTarget` to `core-menu` might be worth a try.

Xiao Cao

unread,
Jun 18, 2015, 7:33:13 PM6/18/15
to w...@dartlang.org
Could you please explain it in more details. Where should I modify the sizingTarget attribute.  Is it possible to do it in the html file. Or do I have to query all dropdown element and set their attribute in dart. Can I set the value directly?

Thank you very much!!!
Reply all
Reply to author
Forward
0 new messages