Skip to content

Conversation

@dhavalveera
Copy link
Contributor

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

fix #1269

image

@bolt-new-by-stackblitz
Copy link

Review PR in StackBlitz Codeflow Run & review this pull request in StackBlitz Codeflow.

@vercel
Copy link

vercel bot commented Feb 15, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
flowbite-react ✅ Ready (Inspect) Visit Preview 💬 Add feedback Mar 12, 2024 0:39am
@codecov
Copy link

codecov bot commented Feb 15, 2024

Codecov Report

Attention: Patch coverage is 82.85714% with 6 lines in your changes are missing coverage. Please review.

Project coverage is 97.29%. Comparing base (7461173) to head (9d328a5).
Report is 197 commits behind head on main.

Files Patch % Lines
src/components/Button/ButtonGroup.tsx 82.85% 6 Missing ⚠️
Additional details and impacted files
@@ Coverage Diff @@ ## main #1273 +/- ## ========================================== - Coverage 99.54% 97.29% -2.26%  ========================================== Files 163 216 +53 Lines 6621 9245 +2624 Branches 401 542 +141 ========================================== + Hits 6591 8995 +2404  - Misses 30 250 +220 

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@dhavalveera
Copy link
Contributor Author

dhavalveera commented Feb 15, 2024

@SutuSebastian - please have a look & review the fix of the bug mentioned in Issue #1269 .

@SutuSebastian SutuSebastian changed the title fix(ButtonGroup.tsx): dynamic generated button with group wasnt styled properly fix(ButtonGroup): dynamic generated button with group wasn't styled properly Feb 15, 2024
@dhavalveera
Copy link
Contributor Author

Hello @SutuSebastian , Sorry to bother you, but can you please review this PR?

Copy link
Collaborator

@SutuSebastian SutuSebastian left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is a quick fix, we need to find a way to target the Button component while recursively searching through children, and only inject props into the button, not all children components.

let's merge this until that "final" solution appears

…t styled properly Dynamically generated buttons within a button group are not properly styled. themesberg#1269 fix themesberg#1269
@SutuSebastian SutuSebastian force-pushed the fix/button-group-dynamic branch from 33ae831 to 9d328a5 Compare March 12, 2024 12:35
@dhavalveera
Copy link
Contributor Author

this is a quick fix, we need to find a way to target the Button component while recursively searching through children, and only inject props into the button, not all children components.

let's merge this until that "final" solution appears

Yeah!. Let's find a proper solution for it

@dhavalveera
Copy link
Contributor Author

@SutuSebastian - this codecov issue again

@SutuSebastian SutuSebastian merged commit d0dc810 into themesberg:main Mar 12, 2024
@chunkerchunker
Copy link
Contributor

this is a quick fix, we need to find a way to target the Button component while recursively searching through children, and only inject props into the button, not all children components.
let's merge this until that "final" solution appears

Yeah!. Let's find a proper solution for it

Suggested fix in #1323

@github-actions github-actions bot mentioned this pull request Mar 29, 2024
SutuSebastian pushed a commit that referenced this pull request Jun 19, 2024
* Fix React warning in ButtonGroup This change fixes the following issue: ButtonGroup was adding positionInGroup to all children rather than just Buttons. For example, in the following, both the Buttons and the child spans get positionInGroup props: ``` <Button.Group><Button><span>b1</span></Button><Button><span>b2</span></Button></Button.Group> ``` This results in a React warning: “Warning: React does not recognize the `positionInGroup` prop on a DOM element...” The review comment in the original code change causing this hints at this issue as well: #1273 (comment) * fix formatting
jhlee-gsenergy pushed a commit to gswindpower/flowbite-react that referenced this pull request Feb 6, 2025
* Fix React warning in ButtonGroup This change fixes the following issue: ButtonGroup was adding positionInGroup to all children rather than just Buttons. For example, in the following, both the Buttons and the child spans get positionInGroup props: ``` <Button.Group><Button><span>b1</span></Button><Button><span>b2</span></Button></Button.Group> ``` This results in a React warning: “Warning: React does not recognize the `positionInGroup` prop on a DOM element...” The review comment in the original code change causing this hints at this issue as well: themesberg#1273 (comment) * fix formatting
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

3 participants