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

No ability to add prefix or suffix to paper-input Widget #87

Closed cpboyd closed 8 years ago

cpboyd commented 8 years ago

You can do a new PaperInput("<div suffix>meters</div>") on creation, but there's no easy way to add a prefix or suffix after the fact.

Moreover, attempting to append a widget with the suffix attribute doesn't work properly.

PaperDropdownMenu dropdownMenu = new PaperDropdownMenu();
dropdownMenu.setAttribute("suffix")
input.add(dropdownMenu)

The above code just results in the dropdown menu appearing below the paper-input line.

manolo commented 8 years ago

It's not a problem on the PaperDropdownMenu widget but the original polymer element paper-dropdown-menu, try this in JS:

   i = document.createElement('paper-input')
   d.appendChild(i)
   p = document.createElement('paper-dropdown-menu')
   p.setAttribute('suffix', '')
   i.appendChild(p);

It only reads the light dom when it is created, so my suggestion is that you use uibinder, or the constructor.