From cba8f5864946f3d834ebd03452b0512137765980 Mon Sep 17 00:00:00 2001 From: Katie McFaul Date: Thu, 17 Aug 2023 10:33:17 -0400 Subject: [PATCH 1/2] docs(TextArea): add onFocus/onBlur props to table --- packages/react-core/src/components/TextArea/TextArea.tsx | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/packages/react-core/src/components/TextArea/TextArea.tsx b/packages/react-core/src/components/TextArea/TextArea.tsx index 055930dd160..5a768d8d43e 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 input is focused */ + onFocus?: (event?: any) => void; + /** Callback function when text input is blurred (focus leaves) */ + onBlur?: (event?: any) => 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 { >