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

Dropdown: Allow to pass "className" with a group as well #5047

Closed
dominikj111 opened this issue Oct 6, 2023 · 4 comments · Fixed by #5052
Closed

Dropdown: Allow to pass "className" with a group as well #5047

dominikj111 opened this issue Oct 6, 2023 · 4 comments · Fixed by #5052
Assignees
Labels
Type: Enhancement Issue contains an enhancement related to a specific component. Additional functionality has been add
Milestone

Comments

@dominikj111
Copy link

Describe the feature you would like to see added

I need to pass a specific className with the options group along with the "p-dropdown-item-group" class.
It is possible to do this with an item only.
https://codesandbox.io/s/primereact-dropdown-panel-width-yp9v59?file=/src/App.js

Is your feature request related to a problem?

I have first group without the label what causes to render additional white space on the start of the list of options.

Describe the solution you'd like

No response

Describe alternatives you have considered

No response

Additional context

No response

@dominikj111 dominikj111 added Status: Discussion Issue or pull request needs to be discussed by Core Team Type: New Feature Issue contains a new feature or new component request labels Oct 6, 2023
@github-actions github-actions bot added the Status: Needs Triage Issue will be reviewed by Core Team and a relevant label will be added as soon as possible label Oct 6, 2023
@melloware
Copy link
Member

Isn't that just this: https://codesandbox.io/s/primereact-dropdown-panel-width-forked-zc2kw3

pt={{
            itemGroup: ({ context }) => ({
              className: "bg-primary"
            })
          }}

@melloware melloware added Resolution: By Design The behavior in the issue is by design and the component exhibits the expected behavior and removed Type: New Feature Issue contains a new feature or new component request Status: Discussion Issue or pull request needs to be discussed by Core Team Status: Needs Triage Issue will be reviewed by Core Team and a relevant label will be added as soon as possible labels Oct 6, 2023
@dominikj111
Copy link
Author

dominikj111 commented Oct 6, 2023

Sounds like that, but I would like to pass className in relation to specific item on same way as I'm doing when not using groups. So I need to pass it in the options structure.

@melloware
Copy link
Member

Got it i think it just needs the extra data passed to it!

@melloware melloware added Type: Enhancement Issue contains an enhancement related to a specific component. Additional functionality has been add and removed Resolution: By Design The behavior in the issue is by design and the component exhibits the expected behavior labels Oct 6, 2023
@melloware melloware self-assigned this Oct 6, 2023
@melloware melloware added this to the 10.0.3 milestone Oct 6, 2023
melloware added a commit to melloware/primereact that referenced this issue Oct 6, 2023
@melloware
Copy link
Member

@dominikj111 please review my PR. Now it adds the optionGroupLabel to the context as well as adds the style empty if the label is empty.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: Enhancement Issue contains an enhancement related to a specific component. Additional functionality has been add
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants