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

Bug: Component's name that's a prefix of another can't be nested #530

Closed
desiprisg opened this issue Dec 6, 2023 · 2 comments · Fixed by #558
Closed

Bug: Component's name that's a prefix of another can't be nested #530

desiprisg opened this issue Dec 6, 2023 · 2 comments · Fixed by #558
Assignees

Comments

@desiprisg
Copy link

Noticed this while implementing an <Accordion />. I've added overrides for <Accordion /> and <AccordionItem /> and it seems that when nesting these, the outside element is not placed correctly.

Simplified example:

overrides: {
     Accordion: ({ children }) => children,
     AccordionItem: ({ children }) => children,
}

will yield:
image

If Accordion was not a prefix of AccordionItem, this would work as expected.

@alfianyusufabdullah
Copy link

Hi @desiprisg , I think you should adjust the indentation of the components you've added. Here is an example with the same case that I've already created.

image

@desiprisg
Copy link
Author

@alfianyusufabdullah The issue appears when the nested component has a different name (prefixed by the first component's name). Try naming the second one CalloutSubmission2.

@quantizor quantizor self-assigned this Mar 13, 2024
quantizor added a commit that referenced this issue Mar 21, 2024
quantizor added a commit that referenced this issue Mar 21, 2024
Innei pushed a commit to Innei/markdown-to-jsx that referenced this issue Mar 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants