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

Dynamically generated buttons within a button group are not properly styled. #1269

Closed
2 tasks done
lehelk opened this issue Feb 11, 2024 · 1 comment · Fixed by #1273 or #1325
Closed
2 tasks done

Dynamically generated buttons within a button group are not properly styled. #1269

lehelk opened this issue Feb 11, 2024 · 1 comment · Fixed by #1273 or #1325
Labels
🐛 bug Something isn't working confirmed This bug was confirmed

Comments

@lehelk
Copy link

lehelk commented Feb 11, 2024

  • I have searched the Issues to see if this bug has already been reported
  • I have tested the latest version

Steps to reproduce

<div className='mb-4'>
  <ButtonGroup>
    <Button>Button 1</Button>
    <Button>Button 2</Button>
    <Button>Button 3</Button>
    <Button>Button 4</Button>
    <Button>Button 5</Button>
  </ButtonGroup>
</div>
<div className='mb-4'>
  <ButtonGroup>
    <Button>Button 1</Button>
    {[2, 3, 4].map(value => <Button key={value}>Button {value}</Button>)}
    <Button>Button 5</Button>
  </ButtonGroup>
</div>

Will have the following result:
Screenshot 2024-02-11 at 17 44 58

Current behavior

On the second line in the provided screenshot (where there are dynamically generated buttons) the 3rd button has rounded borders on the right hand side while the 5th button doesn't have rounded borders on the right hand side.

Expected behavior

On the second line in the provided screenshot (where there are dynamically generated buttons) the 3rd button shouldn't have any rounded borders while the 5th button should have rounded borders on the right hand side.

@SutuSebastian
Copy link
Collaborator

Known issue, it's because the Children.map() does not go deeper than one level, so the props are not injected in the dynamically generated buttons due to being an [] array instead of a ReactNode or JSX.Element.

@SutuSebastian SutuSebastian added confirmed This bug was confirmed 🐛 bug Something isn't working labels Feb 12, 2024
dhavalveera added a commit to dhavalveera/flowbite-react that referenced this issue Feb 15, 2024
…t styled properly

Dynamically generated buttons within a button group are not properly styled. themesberg#1269

fix themesberg#1269
SutuSebastian pushed a commit to dhavalveera/flowbite-react that referenced this issue Mar 12, 2024
…t styled properly

Dynamically generated buttons within a button group are not properly styled. themesberg#1269

fix themesberg#1269
SutuSebastian pushed a commit that referenced this issue Mar 12, 2024
…roperly (#1273)

fix(/button/buttongroup.tsx): dynamic generated buton with group wasnt styled properly

Dynamically generated buttons within a button group are not properly styled. #1269

fix #1269
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🐛 bug Something isn't working confirmed This bug was confirmed
Projects
None yet
2 participants