Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug]: Dropdown props.titleText is marked as optional in typescript but required in prop-types #17843

Closed
2 tasks done
janhassel opened this issue Oct 23, 2024 · 1 comment · Fixed by #17854
Closed
2 tasks done
Assignees
Labels
component: dropdown good first issue 👋 Used by GitHub to elevate contribution opportunities hacktoberfest See https://hacktoberfest.com/ severity: 4 https://ibm.biz/carbon-severity type: bug 🐛

Comments

@janhassel
Copy link
Member

Package

@carbon/react

Browser

No response

Package version

1.68.0

React version

No response

Description

In typescript, the titleText prop is marked as optional while in the propTypes it's defined as required. This causes a warning in the console even if TS validation succeeds.

titleText: PropTypes.node.isRequired,

Reproduction/example

Steps to reproduce

import { Dropdown } from '@carbon/react';

function MyComponent() {
  return (
    <Dropdown
      id="id"
      label="Label"
      items={['Lorem', 'ipsum', 'dolor']}
    />
  );
}

This passes TS validation but fails propTypes validation.

Suggested Severity

Severity 4 = Unrelated to a user task, has a workaround or does not need a workaround.

Application/PAL

No response

Code of Conduct

@alisonjoseph alisonjoseph added component: dropdown severity: 4 https://ibm.biz/carbon-severity good first issue 👋 Used by GitHub to elevate contribution opportunities hacktoberfest See https://hacktoberfest.com/ and removed status: needs triage 🕵️‍♀️ labels Oct 23, 2024
@alisonjoseph alisonjoseph moved this to ⏱ Backlog in Design System Oct 23, 2024
@Thamjith
Copy link
Contributor

Thamjith commented Oct 23, 2024

Could you please assign this to me? @alisonjoseph , @janhassel

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component: dropdown good first issue 👋 Used by GitHub to elevate contribution opportunities hacktoberfest See https://hacktoberfest.com/ severity: 4 https://ibm.biz/carbon-severity type: bug 🐛
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

3 participants