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

Wrong (outdated) type definition for DropDownGroup and SelectGroup? #11507

Open
ancorgs opened this issue Feb 6, 2025 · 0 comments
Open

Wrong (outdated) type definition for DropDownGroup and SelectGroup? #11507

ancorgs opened this issue Feb 6, 2025 · 0 comments

Comments

@ancorgs
Copy link

ancorgs commented Feb 6, 2025

Describe the problem
This is an issue with Patternfly 6 (at least)

The label property of MenuGroup is declared as type ReactNode. It can indeed handle that and we use it at Agama.

But in the case of DropDownGroup and SelectGroup the properties label are defined as type string. They can actually handle everything that MenuGroup's label can handle (eg. see agama-project/agama#1977).

Internally SelectGroup is using MenuGroup. So the limitation doesn't make fully sense to me, although it could be intentional for some reason I'm overlooking.

MenuGroup#label was an string until two years ago, #8219 and the component itself was added 5 years ago e867f09 While the SelectGroup#label types dates from 6 years ago. All that makes me think that those types were simply left behind by omission.

How do you reproduce the problem?

See agama-project/agama#1977

Expected behavior

Type check does not fail when a ReactNode is used as label for DropDownGroup or SelectGroup.

Is this issue blocking you?

The workarounds are to disable type checking for that file or to use a Menu instead of a DropDown. Both doable but annoying.

@mcoker mcoker transferred this issue from patternfly/patternfly Feb 6, 2025
@thatblindgeye thatblindgeye moved this from Needs triage to Backlog in PatternFly Issues Feb 13, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Backlog
Development

No branches or pull requests

1 participant