Skip to content

Commit 9cfbdbd

Browse files
i8raminadamraider
authored andcommitted
fix(textarea): allow multi-row textarea (#16)
* feat(component): allow multi-row textarea when rows are provided to a textarea, the fixed height is removed and set to "auto" * fix: fix storybook and adjust scss * Update docs/components/text-field.md Co-Authored-By: i8ramin <49030+i8ramin@users.noreply.github.com> * Update packages/core/src/components/text-field/_text-field.scss Co-Authored-By: i8ramin <49030+i8ramin@users.noreply.github.com>
1 parent 1b6a799 commit 9cfbdbd

File tree

4 files changed

+27
-1
lines changed

4 files changed

+27
-1
lines changed

docs/components/text-field.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,13 @@ title: Text Field
1919
>
2020
</component>
2121

22+
<component
23+
name="Text area with rows"
24+
component="text-area"
25+
variation="text-area-multi-row"
26+
>
27+
</component>
28+
2229
<component
2330
name="Text field with hints"
2431
component="text-field"
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
<div class="ray-text-area">
2+
<textarea
3+
rows="4"
4+
class="ray-text-area__input"
5+
id="notes"
6+
type="email"
7+
placeholder="adding `rows` overrides default height"
8+
></textarea>
9+
<label class="ray-text-area__label" for="notes">
10+
Long notes
11+
</label>
12+
</div>

packages/core/src/components/text-field/_text-field.scss

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -169,4 +169,11 @@
169169
}
170170
}
171171
}
172+
173+
[rows].#{$ray-class-prefix}text-area {
174+
&__input {
175+
height: auto; // ie11 fallback
176+
height: unset;
177+
}
178+
}
172179
}

packages/core/stories/text-field.stories.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ storiesOf('Text Field', module)
6565
<div className="ray-text-area">
6666
<textarea
6767
className="ray-text-area__input"
68-
row="4"
68+
rows="4"
6969
id="textarea"
7070
placeholder="Few people are aware..."
7171
/>

0 commit comments

Comments
 (0)