Sage / carbon

Carbon by Sage | ReactJS UI Component Library
https://carbon.sage.com
Apache License 2.0
273 stars 85 forks source link

[ButtonToggleGroup] - Missing id on ButtonToggleGroup props type #5314

Closed michalgarnczarski closed 1 year ago

michalgarnczarski commented 2 years ago

Current behaviour

I got error in console about missing id for ButtonToggleGroup, when I try to set this value I got a typescirpt error like below:

Type '{ children: Element[]; id: string; mb: number; name: string; value: string; onChange: (event: ChangeEvent<HTMLInputElement>) => void; }' is not assignable to type 'IntrinsicAttributes & ButtonToggleGroupProps'.
  Property 'id' does not exist on type 'IntrinsicAttributes & ButtonToggleGroupProps'.ts(2322)

Even when the id is set like in CodeSandbox example, error still apprise in console.

Expected behaviour

Props types for ButtonToggleGroup should include id and the id should be correct passing to FormField component.

CodeSandbox or Storybook URL

https://codesandbox.io/s/festive-solomon-qx0umm?file=/src/index.js

JIRA Ticket (Sage Only)

No response

Suggested Solution

No response

Carbon Version

109.1.1

Design Tokens Version

No response

What browsers are you seeing the problem on?

Chrome

What Operating System are you seeing the problem on?

Windows, Linux

Anything else we should know?

No response

Confidentiality

Parsium commented 2 years ago

Thanks for raising this @michalgarnczarski. We are aware of this issue and plan to release a fix for this as part of FE-4854 #5212