diff --git a/packages/react-core/src/components/TextArea/TextArea.tsx b/packages/react-core/src/components/TextArea/TextArea.tsx index 055930dd160..0c870cf743d 100644 --- a/packages/react-core/src/components/TextArea/TextArea.tsx +++ b/packages/react-core/src/components/TextArea/TextArea.tsx @@ -36,6 +36,10 @@ export interface TextAreaProps extends Omit, 'onC value?: string | number; /** A callback for when the text area value changes. */ onChange?: (event: React.ChangeEvent, value: string) => void; + /** Callback function when text area is focused */ + onFocus?: (event?: React.FocusEvent) => void; + /** Callback function when text area is blurred (focus leaves) */ + onBlur?: (event?: React.FocusEvent) => void; /** Sets the orientation to limit the resize to */ resizeOrientation?: 'horizontal' | 'vertical' | 'both'; /** Custom flag to show that the text area requires an associated id or aria-label. */ @@ -114,6 +118,8 @@ class TextAreaBase extends React.Component { autoResize, onChange, /* eslint-enable @typescript-eslint/no-unused-vars */ + onBlur, + onFocus, ...props } = this.props; const orientation = `resize${capitalize(resizeOrientation)}` as @@ -136,6 +142,8 @@ class TextAreaBase extends React.Component { >