Skip welcome & menu and move to editor
Welcome to JS Bin
Load cached copy from
 
<!DOCTYPE html>
<html>
<head>
  <base href="http://polygit.org/components/">
  <meta charset="utf-8">
  <meta name="viewport" content="width=device-width">
  <title>JS Bin</title>
  <link href="polymer/polymer.html" rel="import">
  <link href="iron-a11y-keys/iron-a11y-keys.html" rel="import">
</head>
<body>
  <x-foo></x-foo>
  <dom-module id="x-foo">
    <template>
      <iron-a11y-keys
        target="[[_target]]"
        keys="shift+enter enter"
        on-keys-pressed="_onKeyPress"></iron-a11y-keys>
      <input type="text" value="{{_value::input}}" id="input">
    </template>
    <script>
      Polymer({
        is: 'x-foo',
        properties: {
          _value: {
            type: String
          },
          _target: {
            value: function() {
              return this.$.input;
            }
          }
        },
        _onKeyPress: function(e) {
          e.detail.keyboardEvent.preventDefault();
          console.log(e.detail.combo);
        }
      });
    </script>
  </dom-module>
</body>
</html>
Output

You can jump to the latest bin by adding /latest to your URL

Dismiss x
public
Bin info
anonymouspro
0viewers