简体   繁体   English

<iron-label>不将水龙头转发给<paper-radio-button>

[英]<iron-label> not forwarding taps to <paper-radio-button>

<div class="center horizontal layout">
      <iron-label>
        paper radio button
        <paper-radio-button noink iron-label-target>Radio</paper-radio-button>
      </iron-label>
</div>

Clicking on text paper radio button not forwarding clicks to the radio button but the documentation says: All taps on the iron-label will be forwarded to the "target" element. 单击文本paper radio button不转发会单击该单选按钮,但是文档说: iron-label上的所有水龙头都将转发到“目标”元素。

It's working in this JS Bin for me. 它正在我的JS Bin中工作。

<!doctype html>
<html>

<head>
  <meta name="description" content="http://stackoverflow.com/questions/37816458">
  <meta charset="utf-8">
  <base href="http://polygit.org/components/">
  <script href="webcomponentsjs/webcomponents-lite.min.js"></script>
  <link href="polymer/polymer.html" rel="import">
  <link href="iron-label/iron-label.html" rel="import">
  <link href="paper-radio-button/paper-radio-button.html" rel="import">
</head>

<body>
  <dom-module id="my-el">
    <template>
      <iron-label>
        clicking here should forward tap to paper-radio-button
        <paper-radio-button noink iron-label-target on-tap="radioButtonTapped">Radio</paper-radio-button>
      </iron-label>
    </template>
    <script>
      Polymer({
        is: 'my-el',
        radioButtonTapped: function (e) {
          console.log('tap');
        }
      });
    </script>
  </dom-module>
  <my-el></my-el>
</body>

</html>

https://jsbin.com/juzewi/edit?html,console,output https://jsbin.com/juzewi/edit?html,控制台,输出

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM