Skip to content
This repository has been archived by the owner on Mar 13, 2018. It is now read-only.

Commit

Permalink
Merge pull request #109 from DamianGarro/patch-1
Browse files Browse the repository at this point in the history
paper-autogrow-textarea: break long words in mirror
  • Loading branch information
Yvonne Yip committed Dec 16, 2014
2 parents ab2ab59 + 5ec201a commit 6777060
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 0 deletions.
1 change: 1 addition & 0 deletions paper-autogrow-textarea.html
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@

.mirror-text {
visibility: hidden;
word-wrap: break-word;
}

::content textarea {
Expand Down
14 changes: 14 additions & 0 deletions test/autogrow.html
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,20 @@
assert.equal(getComputedStyle(a1.$.mirror).visibility, 'hidden');
});

test('grows with a long word', function(done) {
var h1 = a1.offsetHeight;

t1.value = Array(1000).join("P");
dispatchInputEvent(t1);

flush(function() {
var h2 = a1.offsetHeight;
assert.ok(h2 > h1);
assert.deepEqual(a1.getBoundingClientRect(), t1.getBoundingClientRect());
done();
});
});

});

</script>
Expand Down

0 comments on commit 6777060

Please sign in to comment.