Skip to content

Commit 8515d01

Browse files
author
Petr Krotov
committed
fix: change screenshots
1 parent f78913e commit 8515d01

File tree

6 files changed

+12
-7
lines changed

6 files changed

+12
-7
lines changed

src/components/controls/TextArea/TextArea.scss

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,7 @@ $block: '.#{variables.$ns}text-area';
1010
--_--placeholder-color: var(--g-color-text-hint);
1111
--_--background-color: transparent;
1212
--_--border-width: #{control-variables.$border-width};
13-
--_--clear-offset: calc(
14-
var(--g-text-area-border-width, #{control-variables.$border-width}) + 1px
15-
);
13+
--_--clear-offset: calc(var(--g-text-area-border-width, #{control-variables.$border-width}));
1614
--_--focus-outline-color: var(--g-text-area-focus-outline-color);
1715

1816
display: inline-block;
@@ -77,10 +75,6 @@ $block: '.#{variables.$ns}text-area';
7775
}
7876

7977
&__clear {
80-
display: flex;
81-
align-items: center;
82-
justify-content: center;
83-
8478
&_size_s,
8579
&_size_m {
8680
inset-inline-end: var(--_--clear-offset);

src/components/controls/TextArea/TextArea.tsx

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,10 +26,15 @@ import './TextArea.scss';
2626
const b = block('text-area');
2727

2828
export type TextAreaProps = BaseInputControlProps<HTMLTextAreaElement> & {
29+
/** The control's html attributes */
2930
controlProps?: React.TextareaHTMLAttributes<HTMLTextAreaElement>;
31+
/** The number of visible text lines for the control. If not specified, the hight will be automatically calculated based on the content */
3032
rows?: number;
33+
/** The number of minimum visible text lines for the control. Ignored if `rows` is specified */
3134
minRows?: number;
35+
/** The number of maximum visible text lines for the control. Ignored if `rows` is specified */
3236
maxRows?: number;
37+
/** An optional element displayed under the lower right corner of the control and sharing the place with the error container */
3338
note?: React.ReactNode;
3439
};
3540

@@ -138,8 +143,10 @@ export const TextArea = React.forwardRef<HTMLSpanElement, TextAreaProps>(
138143

139144
React.useEffect(() => {
140145
const control = innerControlRef.current;
146+
141147
if (control) {
142148
const currHasVerticalScrollbar = control.scrollHeight > control.clientHeight;
149+
143150
if (hasVerticalScrollbar !== currHasVerticalScrollbar) {
144151
setHasVerticalScrollbar(currHasVerticalScrollbar);
145152
}
Loading
-20.3 KB
Loading

src/components/controls/TextArea/__tests__/TextArea.visual.test.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ import {TextArea} from '../TextArea';
66

77
import {
88
disabledCases,
9+
errorPlacementCases,
910
hasClearCases,
1011
maxRowsCases,
1112
minRowsCases,
@@ -94,6 +95,7 @@ test.describe('TextArea', {tag: '@TextArea'}, () => {
9495
} as const,
9596
{
9697
value: valueCases,
98+
errorPlacement: errorPlacementCases,
9799
},
98100
);
99101

src/components/controls/TextArea/__tests__/cases.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@ export const hasClearCases: Array<TextAreaProps['hasClear']> = [true];
1313

1414
export const validationStateCases: Array<TextAreaProps['validationState']> = ['invalid'];
1515

16+
export const errorPlacementCases: Cases<TextAreaProps['errorPlacement']> = ['outside', 'inside'];
17+
1618
export const pinCases: Cases<TextAreaProps['pin']> = [
1719
'round-round',
1820
'brick-brick',

0 commit comments

Comments
 (0)