Skip to content

Commit

Permalink
chore(sample): documented why autoresize is missing
Browse files Browse the repository at this point in the history
  • Loading branch information
Thanood committed Feb 24, 2016
1 parent c4a9852 commit 5807fe2
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 1 deletion.
9 changes: 9 additions & 0 deletions sample/src/samples/input/textarea-sample.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
##### Textareas don't autoresize

The reason for that is there's a "hiddendiv" created on ```document.ready()``` to determine the height of the resized textarea.
That hidden div doesn't exist anymore when the sample app creates real textareas ([see here](https://github.com/Dogfalo/materialize/blob/master/js/forms.js#L111)).
After Aurelia takes control, it replaces the content of its container (meaning ```aurelia-app="main"```).

<br/>

The reference to ```hiddenDiv``` (a variable) is essentially broken once Aurelia kicks in. I'm not sure if there is any good workaround apart from creating such a div manually and outside of Aurelia scope.
6 changes: 5 additions & 1 deletion sample/src/samples/input/textarea.html
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,18 @@
<div class="row">
<ul md-tabs class="z-depth-1">
<li md-waves="color: primary;" class="col"><a class="active" href="#html">Html</a></li>
<li md-waves="color: primary;" class="col"><a class="active" href="#js">Javascript</a></li>
<li md-waves="color: primary;" class="col"><a href="#js">Javascript</a></li>
<li md-waves="color: primary;" class="col"><a href="#doc">Autoresize</a></li>
</ul>
<div id="html" class="z-depth-1">
<au-code language="markup" url="samples/input/textarea-sample.html"></au-code>
</div>
<div id="js" class="z-depth-1">
<au-code language="javascript" url="samples/input/basic-use-sample.js"></au-code>
</div>
<div id="doc" class="z-depth-1" style="padding: 15px;">
<au-markdown url="samples/input/textarea-sample.md"></au-markdown>
</div>
</div>
</md-card>
</div>
Expand Down

0 comments on commit 5807fe2

Please sign in to comment.