manolo / gwt-polymer-elements

Polymer Web Components for GWT. A collection of Material Design widgets for desktop and mobile.
Apache License 2.0
155 stars 49 forks source link

Iron-list is not selectable #109

Open confile opened 8 years ago

confile commented 8 years ago

Using the sample from here: http://vaadin.github.io/gwt-polymer-elements/demo/#iron/IronListSample

The iron-list items are not selectable.

@manolo Is there anything one has to add to make then selectable?

I tried:

  @UiField 
  IronList resultList;

Polymer.ready(resultList.getElement(), arg -> {

       resultList.setSelectionEnabled(true);
       resultList.getPolymerElement().addEventListener(IronSelectEvent.NAME, event -> {

        GWT.log("selected!!");

      });
      return null;
    }); 

but it never fired.

confile commented 8 years ago

The problem is that you cannot set tabindex$="[[tabIndex]]":

<iron-list items="[[data]]" as="item">
  <template>
    <div tabindex$="[[tabIndex]]">
      Name: [[item.name]]
    </div>
  </template>
</iron-list>

UIBinder will not allow this.

confile commented 8 years ago

May be you could add some clever helper method to have a workaround.

manolo commented 7 years ago

could you provide your entire ui.xml file ? seems like you need an auxiliary template for the data binding