From 565e8696e17cc6bc53c08b71060088cbdeffa478 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien?= Date: Fri, 7 Feb 2020 22:48:50 +0100 Subject: [PATCH] fix(carbon-components-react) TileGroup's onChange signature: all arguments are mandatory (#42125) * Updated TileGroup's onChange signature: all arguments are mandatory * Added test for the onChange * fix lint issues * Fixed merge issues --- .../carbon-components-react-tests.tsx | 15 +++++++++++++++ .../lib/components/TileGroup/TileGroup.d.ts | 2 +- 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/types/carbon-components-react/carbon-components-react-tests.tsx b/types/carbon-components-react/carbon-components-react-tests.tsx index 0d022b761d..b4bbf9b6c2 100644 --- a/types/carbon-components-react/carbon-components-react-tests.tsx +++ b/types/carbon-components-react/carbon-components-react-tests.tsx @@ -12,6 +12,7 @@ import { TableBatchActions, TableHeader, TableRow, + TileGroup, TooltipDefinition, TextArea, TextInput, @@ -268,6 +269,20 @@ const uisLinkT5 = ( element={TestComp3} someProp="asdf">Testing Overwrite ); +// TileGroup +// Value nor name can be undefined +let value: string|number = 5; +let name = "old name"; +const tileGroupA = ( + { + value = newVal; + name = newName; + }} + /> +); + // TooltipDefinition const tooltipDefHasAlign = ( diff --git a/types/carbon-components-react/lib/components/TileGroup/TileGroup.d.ts b/types/carbon-components-react/lib/components/TileGroup/TileGroup.d.ts index 6089f6fbf1..11aef5b232 100644 --- a/types/carbon-components-react/lib/components/TileGroup/TileGroup.d.ts +++ b/types/carbon-components-react/lib/components/TileGroup/TileGroup.d.ts @@ -12,7 +12,7 @@ interface InheritedProps { export interface TileGroupProps extends InheritedProps { defaultSelected?: TileGroupProps["valueSelected"], legend?: string, - onChange?(value: TileGroupProps["valueSelected"], name: TileGroupProps["name"], event: RadioTileChangeEvent): void, + onChange?(value: NonNullable, name: NonNullable, event: RadioTileChangeEvent): void, valueSelected?: string | number, }