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

[Input] slots overrides for startDecorator and endDecorator are not populated #38281

Open
2 tasks done
oleksii-aisulov-mck opened this issue Aug 2, 2023 · 1 comment
Open
2 tasks done
Assignees
Labels
component: text field This is the name of the generic UI component, not the React module! status: expected behavior Does not imply the behavior is intended. Just that we know about it and can't work around it

Comments

@oleksii-aisulov-mck
Copy link

Duplicates

  • I have searched the existing issues

Latest version

  • I have tested the latest version

Steps to reproduce 🕹

Link to live example:
https://codesandbox.io/s/thirsty-germain-4c4d9p?file=/src/App.js

Steps:

  1. create a custom slots config for the <Input /> component
  2. try to override startDecorator or endDecorator slots

in the CopePen attached you can see that overriding has no effect on the DOM but input component is populated correctly

Current behavior 😯

slots for startDecorator and endDecorator are not populated, element is not visible in the DOM

Expected behavior 🤔

slots for startDecorator and endDecorator are populated with components that are passed

Context 🔦

No response

Your environment 🌎

No response

@oleksii-aisulov-mck oleksii-aisulov-mck added the status: waiting for maintainer These issues haven't been looked at yet by a maintainer label Aug 2, 2023
@sai6855 sai6855 self-assigned this Aug 3, 2023
@mnajdova mnajdova removed their assignment Aug 7, 2023
@mnajdova mnajdova added the bug 🐛 Something doesn't work label Aug 7, 2023
@mnajdova mnajdova assigned siriwatknp and unassigned sai6855 Aug 7, 2023
@ZeeshanTamboli ZeeshanTamboli removed the status: waiting for maintainer These issues haven't been looked at yet by a maintainer label Aug 23, 2023
@siriwatknp siriwatknp added status: expected behavior Does not imply the behavior is intended. Just that we know about it and can't work around it and removed bug 🐛 Something doesn't work labels Sep 1, 2023
@siriwatknp
Copy link
Member

Thanks for reporting the issue but I think this is expected. The slots.endDecorator is a wrapper component to render endDecorator element.

If you use slots.endDecorator, it means that you want to override the default wrapper and providing your own component but the endDecorator won't be rendered if you don't provide it as a prop to Input component.

Here is an example if you want to remove the default wrapper:

function Dummy({ children }){
  return children;
}

<Input endDecorator={<Button />} slots={{ endDecorator: Dummy }} />

@oliviertassinari oliviertassinari added component: text field This is the name of the generic UI component, not the React module! and removed component: input labels Nov 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component: text field This is the name of the generic UI component, not the React module! status: expected behavior Does not imply the behavior is intended. Just that we know about it and can't work around it
Projects
None yet
Development

Successfully merging a pull request may close this issue.

7 participants