Skip to content

Commit 695fd2a

Browse files
committed
fix(form): Added missing containerProps to TextArea
1 parent 3c10a1c commit 695fd2a

1 file changed

Lines changed: 12 additions & 0 deletions

File tree

packages/form/src/text-field/TextArea.tsx

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import React, {
22
CSSProperties,
33
forwardRef,
4+
HTMLAttributes,
45
ReactElement,
56
ReactNode,
67
Ref,
@@ -112,6 +113,15 @@ export interface TextAreaProps
112113
* default ref is forwarded on to the `input` element.
113114
*/
114115
containerRef?: Ref<HTMLDivElement>;
116+
117+
/**
118+
* Any additional html attributes that should be applied to the main container
119+
* div. This is probably only going to be used internally so that additional
120+
* accessibility can be added to text fields for more complex widgets.
121+
*
122+
* @since 2.5.2
123+
*/
124+
containerProps?: Omit<HTMLAttributes<HTMLDivElement>, "style" | "className">;
115125
}
116126

117127
const block = bem("rmd-textarea");
@@ -130,6 +140,7 @@ export const TextArea = forwardRef<HTMLTextAreaElement, TextAreaProps>(
130140
areaStyle,
131141
areaClassName,
132142
containerRef,
143+
containerProps,
133144
label,
134145
labelStyle,
135146
labelClassName,
@@ -317,6 +328,7 @@ export const TextArea = forwardRef<HTMLTextAreaElement, TextAreaProps>(
317328

318329
return (
319330
<TextFieldContainer
331+
{...containerProps}
320332
style={{
321333
...style,
322334
height: height

0 commit comments

Comments
 (0)