How to clear textarea inside paper-input-decorator?

605 views
Skip to first unread message

yavor.ivan...@gmail.com

unread,
Nov 26, 2014, 10:18:16 AM11/26/14
to polym...@googlegroups.com
I can't clear textarea value inside paper-input-decorator. Here is the code:

-----------------------
    <paper-input-decorator
      id="title_decorator"
      label="Title"
      error="Value must be set!"
      isInvalid="{{!$.title_input.validity.valid}}"
      floatingLabel>
      <paper-autogrow-textarea>
        <textarea id="title_input" is="core-input" value="{{title}}" required></textarea>
      </paper-autogrow-textarea>
    </paper-input-decorator>
-----------------------

No one of the following methods doesn't work:

1) 

this.value = "";

2) 

this.value = "";
this.$.title_input.commit();

3) 

this.value = "";
this.$.title_input.value = "';
this.$.title_input.committedValue = "';

Could anyone help? 

brei...@gmail.com

unread,
Nov 28, 2014, 7:55:59 AM11/28/14
to polym...@googlegroups.com, yavor.ivan...@gmail.com
You also have to call update() on the paper-autogrow-textarea component.

Here is an example:

<paper-autogrow-textarea id="chatAutoGrow">
  <textarea id="chatInput"></textarea>
</paper-autogrow-textarea>

this.$.chatInput.value = '';
this.$.chatAutoGrow.update('');

yavor.ivan...@gmail.com

unread,
Jan 22, 2015, 10:13:18 AM1/22/15
to polym...@googlegroups.com, yavor.ivan...@gmail.com, brei...@gmail.com
Thanks!
Reply all
Reply to author
Forward
0 new messages