From abcf09cba4d9da331173fe2f4d6bd9ea33cf1212 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien?= Date: Fri, 7 Feb 2020 22:10:37 +0100 Subject: [PATCH] fix(carbon-components-react) Added ref for inputs and textareas (#42187) * Added support of ref for TextArea and Input * removed old code * Reused the old forwardingcomponent + added number * removed forward ref from NumberInput * lint fix --- .../carbon-components-react-tests.tsx | 73 ++++++++++++++++++- .../components/NumberInput/NumberInput.d.ts | 7 +- .../lib/components/TextArea/TextArea.d.ts | 5 +- .../TextInput/ControlledPasswordInput.d.ts | 2 +- .../components/TextInput/PasswordInput.d.ts | 2 +- .../lib/components/TextInput/props.d.ts | 5 +- .../typings/shared.d.ts | 4 + 7 files changed, 88 insertions(+), 10 deletions(-) diff --git a/types/carbon-components-react/carbon-components-react-tests.tsx b/types/carbon-components-react/carbon-components-react-tests.tsx index 87db4e8875..0d022b761d 100644 --- a/types/carbon-components-react/carbon-components-react-tests.tsx +++ b/types/carbon-components-react/carbon-components-react-tests.tsx @@ -5,6 +5,7 @@ import { DataTableCustomRenderProps, DataTableHeader, DataTableRow, + NumberInput, Slider, Tab, Table, @@ -12,6 +13,8 @@ import { TableHeader, TableRow, TooltipDefinition, + TextArea, + TextInput, } from 'carbon-components-react'; import Link from 'carbon-components-react/lib/components/UIShell/Link'; @@ -267,7 +270,7 @@ const uisLinkT5 = ( // TooltipDefinition const tooltipDefHasAlign = ( - + ); const tooltipDefHasTriggerClassName = ( @@ -295,3 +298,71 @@ const SliderHasOnChange = ( onChange={(newValue) => newValue.value} /> ); + +// TextArea +const textAreaWithDefaultRef = ( +