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

Fix textarea padding #391

Merged
merged 2 commits into from
Jul 12, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 19 additions & 7 deletions pug/contents/text_inputs_content.html
Original file line number Diff line number Diff line change
Expand Up @@ -319,21 +319,33 @@ <h3 class="header">Textarea</h3>
<form class="col s12">
<div class="row">
<div class="input-field col s12">
<textarea id="textarea1" class="materialize-textarea"></textarea>
<textarea id="textarea1" class="materialize-textarea" placeholder=" "></textarea>
<label for="textarea1">Textarea</label>
</div>
</div>
<div class="row">
<div class="input-field col s12">
<textarea id="textarea2" class="materialize-textarea" placeholder="A custom placeholder :)"></textarea>
<label for="textarea2">Textarea with placeholder</label>
</div>
</div>
</form>
</div>
<pre><code class="language-markup">
&lt;div class="row">
&lt;form class="col s12">
&lt;div class="row">
&lt;div class="input-field col s12">
&lt;textarea id="textarea1" class="materialize-textarea">&lt;/textarea>
&lt;textarea id="textarea1" class="materialize-textarea" placeholder=" ">&lt;/textarea>
&lt;label for="textarea1">Textarea&lt;/label>
&lt;/div>
&lt;/div>
&lt;div class="row">
&lt;div class="input-field col s12">
&lt;textarea id="textarea2" class="materialize-textarea" placeholder="A custom placeholder :)">&lt;/textarea>
&lt;label for="textarea2">Textarea with placeholder&lt;/label>
&lt;/div>
&lt;/div>
&lt;/form>
&lt;/div>
</code></pre>
Expand All @@ -351,7 +363,7 @@ <h5>Icon Prefixes</h5>
<div class="row">
<div class="input-field col s12">
<i class="material-icons prefix">mode_edit</i>
<textarea id="icon_prefix2" class="materialize-textarea"></textarea>
<textarea id="icon_prefix2" class="materialize-textarea" placeholder=" "></textarea>
<label for="icon_prefix2">Message</label>
</div>
</div>
Expand Down Expand Up @@ -444,13 +456,13 @@ <h3 class="header">Character Counter</h3>
<form class="col s12">
<div class="row">
<div class="input-field col s6">
<input id="input_text" type="text" maxlength="10">
<input id="input_text" type="text" maxlength="10" placeholder=" ">
<label for="input_text">Input text</label>
</div>
</div>
<div class="row">
<div class="input-field col s12">
<textarea id="textarea2" class="materialize-textarea" maxlength="120"></textarea>
<textarea id="textarea2" class="materialize-textarea" maxlength="120" placeholder=" "></textarea>
<label for="textarea2">Textarea</label>
</div>
</div>
Expand All @@ -461,13 +473,13 @@ <h3 class="header">Character Counter</h3>
&lt;form class="col s12">
&lt;div class="row">
&lt;div class="input-field col s6">
&lt;input id="input_text" type="text" maxlength="10">
&lt;input id="input_text" type="text" maxlength="10" placeholder=" ">
&lt;label for="input_text">Input text&lt;/label>
&lt;/div>
&lt;/div>
&lt;div class="row">
&lt;div class="input-field col s12">
&lt;textarea id="textarea2" class="materialize-textarea" maxlength="120">&lt;/textarea>
&lt;textarea id="textarea2" class="materialize-textarea" maxlength="120" placeholder=" ">&lt;/textarea>
&lt;label for="textarea2">Textarea&lt;/label>
&lt;/div>
&lt;/div>
Expand Down
3 changes: 2 additions & 1 deletion sass/components/forms/_input-fields.scss
Original file line number Diff line number Diff line change
Expand Up @@ -284,9 +284,10 @@ textarea {
background-color: transparent;

&.materialize-textarea {
padding-top: 26px !important;
padding-bottom: 4px !important;
line-height: normal;
overflow-y: hidden; /* prevents scroll bar flash */
padding: .8rem 0 .8rem 0; /* prevents text jump on Enter keypress */
resize: none;
min-height: $input-height;
box-sizing: border-box;
Expand Down