Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Paper-textarea label not moving as a floating label #555

Closed
lpellegr opened this issue Jul 8, 2017 · 13 comments
Closed

Paper-textarea label not moving as a floating label #555

lpellegr opened this issue Jul 8, 2017 · 13 comments

Comments

@lpellegr
Copy link

lpellegr commented Jul 8, 2017

Description

When a paper-textarea is empty and a call is done to set a new value programmatically, the new content overlaps the label.

Initial rendering:
screenshot from 2017-07-08 18-51-54

After the value is set programmatically:

screenshot from 2017-07-08 19-06-27

Expected outcome

I expect the label to move as a floating label and not stay a resting label:

screenshot from 2017-07-08 19-06-42

Actual outcome

The floating label does not move as a floating label.

Steps to reproduce

  1. Uses Polymer 2
  2. Add a paper-textarea to your page:
<paper-textarea class="form-group" id="content" label="Content" max-rows="0" name="postContent" rows="5" required></paper-textarea>
  1. In ready() method or on button tap, set the value programatically:
this.$.content.value = 'test';

I have tried to use updateValueAndPreserveCaret but the issue is the same.

The issue occurs only when the initial content is empty.

@lpellegr lpellegr changed the title Laper-textarea label not moving as a floating label Paper-textarea label not moving as a floating label Jul 8, 2017
@denishamann
Copy link

Hello, I also have the same issue since a couple of days and can't find the reason why.

@notwaldorf
Copy link
Contributor

If it just broke, would you mind updating web components and trying again? There was a polyfill problem that I think may be the culprit, since we haven't pushed any new changes to this element recently

@krumbunny
Copy link

krumbunny commented Aug 9, 2017

It's been broken for awhile, at least since February.

For users: As a workaround the attribute always-float-label on a paper-textarea element will forgo the resting label, avoiding this issue (but disabling the nifty transition from resting to floating label)

@yairopro
Copy link

Hello.
I've got the same problem.
Hope this problem will soon be solved.
Thanks a lot @krumbunny for the workaround. It works like a charm. I just have to bind the paper-input.value property to this always-float-label property to fix the problem.

@shaeberling
Copy link

I just ran into the same issue today. Any ETA on a fix? Seems like a pretty common problem.

@Ravikumar-Dhanasekaran
Copy link

Similar issue. Not able to fix. Please post any workaround.?

@yairopro
Copy link

yairopro commented Sep 5, 2017

Here's a workaround:
<paper-textarea always-float-label="[[value]]" value="{{value}}"></paper-textarea>
This way it forces the label to float if there's a value in the input.

@kreinholt
Copy link

I believe this is caused by the following commit: PolymerElements/iron-autogrow-textarea@2dba77f. The line this.fire('bind-value-changed', {value: this.bindValue}); has been commented out.

@catiejo
Copy link

catiejo commented Oct 4, 2017

Thank you, @kreinholt! I was also struggling with this bug--I tried uncommenting it and the functionality went back to normal. Also props to the programmer that put this comment above the commented code it: This code is from early 1.0, when this element was a type extension. It's unclear if it's still needed, but leaving in in case it is. It's far from best practice to edit the code directly like this, but I think it's the easiest workaround until there's a less hacky/1.0 fix.

@yglodt
Copy link

yglodt commented Nov 20, 2017

I see the same problem on a paper-input.

@notwaldorf
Copy link
Contributor

Marking this as a duplicate of #508 (and looking at that PR which should fix both of these right now)

@notwaldorf
Copy link
Contributor

(fixed with the 2.1.1 release of iron-autogrow-textarea btw)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

11 participants