File tree Expand file tree Collapse file tree
packages/form/src/text-field Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11import 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
117127const 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
You can’t perform that action at this time.
0 commit comments