1
votes

I've a paper-dropdown-menu element. How can I show a different selected label, than valueattr is targeting at?

<link rel="import" href="components/paper-dropdown-menu/paper-dropdown-menu.html">
<link rel="import" href="components/paper-item/paper-item.html">
<polymer-element name="my-dropdown-element" attributes="selectedModus">
<template>
<paper-dropdown-menu  label="Modus" on-core-select="{{modusSelect}}">
   <paper-dropdown class="dropdown">
      <core-menu class="menu" selected="{{selectedModus}}" valueattr="val">
        <template repeat="{{d in data}}">
           <paper-item val="{{d.val}}">{{d.text}}</paper-item>
        </template>
      </core-menu>
    </paper-dropdown>
</paper-dropdown-menu>
</template>
<script>
Polymer('my-dropdown-element', {
    data: [],
    ready: function() {
      this.data = [];
      var entry = {
        val: 0,
        text: 'Aus'
      };
     this.data.push(entry);
      entry = {
        val: 1,
        text: 'Ein'
      };
      this.data.push(entry);
      entry = {
        val: 2,
        text: 'Auto'
      };
      this.data.push(entry);
      entry = {
        val: 3,
        text: 'Auto (Absenken)'
      };
      this.data.push(entry);
    }
});
</script>
</polymer-element>

When I set selectedModus = 2, the highlighted Item in the opened dropdown is auto. This is correct. But in the dropdown label there is always 0, 1, 2, 3 and not the text representation of the dropdown.

Please help me

Thanks.

edit:

I've deleted all Polymer components from my project. Then I've updated all dependencies via bower from the master's branch of each component.

Now the correct label is showing in the closed dropdown. But clicking on the arrows, doesn't open the drop down menu. I'm getting an error in the timinig-utilities.js which can be traced back to paper-dropdown-transistion.html line 152.

Very strange.

1
Is web-animations-js at the 1.0.1 release or later? (github.com/web-animations/web-animations-js/releases/tag/1.0.1) core-animation depends on web-animations-js#1.0.1 which should be the latest release we've verified as working with Polymer. The master branches are generally in active development and things may break unexpectedly.Yvonne Yip
Thanks for the information about the master branch. I thought the master branch is the currently stable one.drindal

1 Answers

1
votes

Ok i've found the answer to my problem. It seems to be a bug in the current core-animation\web-animations.html. The change mentioned here https://github.com/zenorocha/core-animation/commit/0d047ce11e5e6b25c02f1d89b2e7aa53588d7316 worked for me.