-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
MultiSelect: Can't hide or customize header or items wrapper using stlyed components #7454
Comments
For styling the items you want Second I can hide the header with this CSS .p-multiselect-panel .p-multiselect-header {
display:none;
} |
Yeah that's why I said im using styled components, I can do it with CSS, but as my description says, im using the StyledMultiSelect I created, and even when targeting the correct css styles, they are not applying. My question was because with other components like table, paginator, etc. it works perfectly fine. |
Please fork the Stackblitz project and create a case demonstrating your bug report. This issue will be closed if no activities in 20 days. |
@lukzfern it looks like an EMOTION issue. If you look at the DOM in the inspector the panel does not EXIST when the component is created. It is created and added to the DOM only on popup. So my guess is Emotion doesn't see those in the Dom at Render time so it has nothing to apply. You might have to look at Emotion on how to trigger updating styles when the component re-renders... A lot of PrimeReact components do this so this won't be your last issue. |
Describe the bug
Im trying to do 2 things with the MultiSelect component, hide the header and cusomize the items inside of the wrapper, but seems like the styles im targeting are not working:
<StyledMultiSelect
id="abc"
options={options}
placeholder="Test"
value={selectedValue}
onChange={(e) => setSelectedValue(e.value)}
/>
export const StyledMultiSelect = styled(MultiSelect)({
".p-multiselect-header": { display: "none" },
".p-multiselect-item": { background "red" }
});
none of these are working for me.
Reproducer
demo: https://stackblitz.com/edit/hv8ood?file=src%2FApp.jsx
System Information
Steps to reproduce the behavior
Expected behavior
You should be able to hide the header easily and also style the dropdown items using the selector
The text was updated successfully, but these errors were encountered: