-
Notifications
You must be signed in to change notification settings - Fork 151
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
fix: button group loading #2544
base: master
Are you sure you want to change the base?
Conversation
🦋 Changeset detectedLatest commit: bc674f5 The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
✅ PR title follows Conventional Commits specification. |
This pull request is automatically built and testable in CodeSandbox. To see build info of the built libraries, click here or the icon next to each commit SHA. Latest deployment of this branch, based on commit bc674f5:
|
Bundle Size ReportUpdated Components
|
...(variant === 'secondary' && { | ||
'button[role="button"]:first-child': { | ||
borderRight: 'none', | ||
borderTopLeftRadius: makeBorderSize(theme.border.radius.medium), | ||
borderBottomLeftRadius: makeBorderSize(theme.border.radius.medium), | ||
}, | ||
'button[role="button"]:not(:first-child):not(:last-child)': { | ||
borderLeft: 'none', | ||
borderRight: 'none', | ||
}, | ||
'button[role="button"]:last-child': { | ||
borderLeft: 'none', | ||
borderTopRightRadius: makeBorderSize(theme.border.radius.medium), | ||
borderBottomRightRadius: makeBorderSize(theme.border.radius.medium), | ||
}, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How is this related to loading? 🤔
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Earlier, we added a border to the Button Group container and removed the borders from all individual buttons.
However, when we enabled the loading state for a button, it looked like this:
![Screenshot 2025-02-14 at 3 58 11 PM](https://private-user-images.githubusercontent.com/54894783/413269345-71d85df4-8562-4c0e-8e8a-9cdd55af7124.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3Mzk2NTYwNTIsIm5iZiI6MTczOTY1NTc1MiwicGF0aCI6Ii81NDg5NDc4My80MTMyNjkzNDUtNzFkODVkZjQtODU2Mi00YzBlLThlOGEtOWNkZDU1YWY3MTI0LnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNTAyMTUlMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjUwMjE1VDIxNDIzMlomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTAwZDQ3NmYxMWJmNmFjZDAzMzAyYTQ3YWI1ZDlmMDVmYjM1MmUzMzUzZTQwOTdkMjVmNjdkNmU1MjU4NWU3NjImWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0In0.prMNEkaXpIViFkdSC1KqG07Ytl9nomLtXm7qVg5q0Mc)
I think the ideal way to handle this was to modify the border-radius of the buttons. So, I refactored the Button Group code a bit and also updated how the border is handled for the secondary variant.
![Screenshot 2025-02-14 at 4 08 15 PM](https://private-user-images.githubusercontent.com/54894783/413272802-c0d4c334-3c16-4ae0-a48e-e0abf191165b.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3Mzk2NTYwNTIsIm5iZiI6MTczOTY1NTc1MiwicGF0aCI6Ii81NDg5NDc4My80MTMyNzI4MDItYzBkNGMzMzQtM2MxNi00YWUwLWE0OGUtZTBhYmYxOTExNjViLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNTAyMTUlMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjUwMjE1VDIxNDIzMlomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTA1NzE1ZTNhMzNlYzA1NDA1NjBmNmIxYzRhZTI4N2RiZDQ0MjVjNTA0NzI5OGMxYzQ0NWQ0NmM2MTg4NzI1ZTEmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0In0.YaPLa3m-W_Rh176_tgzK6FPCT20SCINkkW_SPUWXLlk)
Description
this fixes - https://razorpay.atlassian.net/browse/DSSUP-245
Changes
Additional Information
Component Checklist