Variant for slot doesn't work
Open
@siriwatknp is already working on this.
Since Oct 30, 2024.
customization: dom
customization: theme
scope: select
type: bug
- Dominant language
- JavaScript
- Stars
- 99.1k
- Forks
- 32.5k
- Avg merge
- 2d 17h
- Merged PRs (30d)
- 106
Description
Search keywords
variants, slots, props, evaluation
Latest version
- I have tested the latest version
Steps to reproduce
Link to live example: https://stackblitz.com/edit/github-nynfvf?file=src%2Fthene.ts
Steps:
- Customize theme with
components=>MuiSelect=>styleOverrides - Define a variant for
rootandiconslots, both with props:props: { size: 'small' }
Current behavior
Variant for root is recognized and applied, for icon - it's not
Expected behavior
As far as I understand, also a variant for a slot should work.
Context
I tried for the icon a hardcoded props evaluation:
props: () => true
and it works. I also debugged size prop evaluation with:
props: ({ size }) => console.log(size)
and initially it has correct value small but immediately during next evaluation it's undefined What's surprising for me, it behaves exactly the same for root, but doesn't break variant's styling for root 🤔
Your environment
No response
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.