googlearchive / paper-dropdown-menu

A UI control to choose an option from a drop-down menu, similar to a <select>
23 stars 21 forks source link

after disabling and re-enabling, paper-dropdown-menu is no longer tabbable #80

Open antwonthegreat opened 7 years ago

antwonthegreat commented 7 years ago
<link rel="import" href="../../bower_components/polymer/polymer-element.html">
<link rel="import" href="../../bower_components/paper-button/paper-button.html">
<link rel="import" href="../../bower_components/paper-listbox/paper-listbox.html">
<link rel="import" href="../../bower_components/paper-dropdown-menu/paper-dropdown-menu.html">
<link rel="import" href="../../bower_components/paper-item/paper-item.html">

<dom-module id="dropdown-error-app">
  <template>
    <style>
       :host {
        display: block;
      }
    </style>
    <h2>Hello [[prop1]]!</h2>
    <paper-dropdown-menu>
      <paper-listbox slot="dropdown-content">
        <paper-item>1</paper-item>
        <paper-item>2</paper-item>
        <paper-item>3</paper-item>
      </paper-listbox>
    </paper-dropdown-menu>
    <paper-dropdown-menu>
      <paper-listbox slot="dropdown-content">
        <paper-item>1</paper-item>
        <paper-item>2</paper-item>
        <paper-item>3</paper-item>
      </paper-listbox>
    </paper-dropdown-menu>
    <paper-dropdown-menu id="dropdown">
      <paper-listbox slot="dropdown-content">
        <paper-item>1</paper-item>
        <paper-item>2</paper-item>
        <paper-item>3</paper-item>
      </paper-listbox>
    </paper-dropdown-menu>
    <paper-button on-tap="buttonTapped">Toggle disabled</paper-button>
  </template>

  <script>
    /**
     * @customElement
     * @polymer
     */
    class DropdownErrorApp extends Polymer.Element {
      static get is() {
        return 'dropdown-error-app';
      }
      static get properties() {
        return {
          prop1: {
            type: String,
            value: 'dropdown-error-app'
          }
        };
      }

      buttonTapped() {
        this.$.dropdown.disabled = !this.$.dropdown.disabled;
      }
    }

    window.customElements.define(DropdownErrorApp.is, DropdownErrorApp);
  </script>
</dom-module>