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

[test][docs] Improve demos for better regression screenshots #43742

Merged
merged 1 commit into from
Sep 13, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ export default function ExampleAlignmentButtons() {
variant="outlined"
value={alignment}
onChange={(event) => setAlignment(event.target.value)}
sx={{ display: 'inline-flex' }}
>
{['left', 'center', 'right', 'justify'].map((item) => (
<Box
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ export default function ExampleAlignmentButtons() {
onChange={(event: React.ChangeEvent<HTMLInputElement>) =>
setAlignment(event.target.value)
}
sx={{ display: 'inline-flex' }}
Copy link
Member Author

@aarongarciah aarongarciah Sep 13, 2024

Choose a reason for hiding this comment

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

Not ideal to override the display property of the RadioGroup component in our own demos (RadioGroup uses flex). In hindsight, RadioGroup should've probably used inline-flex from the start.

Another option is to wrap the entire demo in an inline-block/flex element, but that probably adds more noise to the demo.

Copy link
Member

Choose a reason for hiding this comment

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

Perhaps something we can introduce as a breaking change in a future major?

>
{['left', 'center', 'right', 'justify'].map((item) => (
<Box
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ export default function ToggleGroupToolbar() {
return (
<Sheet
variant="outlined"
sx={{ borderRadius: 'md', display: 'flex', gap: 2, p: 0.5 }}
sx={{ borderRadius: 'md', display: 'inline-flex', gap: 2, p: 0.5 }}
>
<ToggleButtonGroup
variant="plain"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ export default function ToggleGroupToolbar() {
return (
<Sheet
variant="outlined"
sx={{ borderRadius: 'md', display: 'flex', gap: 2, p: 0.5 }}
sx={{ borderRadius: 'md', display: 'inline-flex', gap: 2, p: 0.5 }}
>
<ToggleButtonGroup
variant="plain"
Expand Down
2 changes: 1 addition & 1 deletion docs/data/material/components/dividers/FlexDivider.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ export default function FlexDivider() {
return (
<Box
sx={{
display: 'flex',
display: 'inline-flex',
alignItems: 'center',
border: '1px solid',
borderColor: 'divider',
Expand Down
2 changes: 1 addition & 1 deletion docs/data/material/components/dividers/FlexDivider.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ export default function FlexDivider() {
return (
<Box
sx={{
display: 'flex',
display: 'inline-flex',
alignItems: 'center',
border: '1px solid',
borderColor: 'divider',
Expand Down
Loading