mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-08-12 04:50:18 +00:00
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
This commit is contained in:
@@ -12,6 +12,7 @@ import {
|
||||
TableBatchActions,
|
||||
TableHeader,
|
||||
TableRow,
|
||||
TileGroup,
|
||||
TooltipDefinition,
|
||||
TextArea,
|
||||
TextInput,
|
||||
@@ -268,6 +269,20 @@ const uisLinkT5 = (
|
||||
<Link<TestCompPropsOverwrite> element={TestComp3} someProp="asdf">Testing Overwrite</Link>
|
||||
);
|
||||
|
||||
// TileGroup
|
||||
// Value nor name can be undefined
|
||||
let value: string|number = 5;
|
||||
let name = "old name";
|
||||
const tileGroupA = (
|
||||
<TileGroup
|
||||
name="my-tile-group-name"
|
||||
onChange={(newVal, newName, e) => {
|
||||
value = newVal;
|
||||
name = newName;
|
||||
}}
|
||||
/>
|
||||
);
|
||||
|
||||
// TooltipDefinition
|
||||
const tooltipDefHasAlign = (
|
||||
<TooltipDefinition tooltipText="my text" align="end" />
|
||||
|
||||
@@ -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<TileGroupProps["valueSelected"]>, name: NonNullable<TileGroupProps["name"]>, event: RadioTileChangeEvent): void,
|
||||
valueSelected?: string | number,
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user