diff --git a/docs/src/modules/components/MaterialYouUsageDemo.tsx b/docs/src/modules/components/MaterialYouUsageDemo.tsx index 6f42e405dfcc02..0bd30c603fb764 100644 --- a/docs/src/modules/components/MaterialYouUsageDemo.tsx +++ b/docs/src/modules/components/MaterialYouUsageDemo.tsx @@ -352,10 +352,18 @@ export default function MaterialYouUsageDemo { - setProps((latestProps) => ({ - ...latestProps, - [propName]: event.target.value, - })); + setProps((latestProps) => { + const variantShouldSpecialUpdate = + componentName === 'LinearProgress' && + propName === 'type' && + event.target.value === 'CircularProgress' && + !['indeterminate', 'determinate'].includes(latestProps.variant); + return { + ...latestProps, + variant: variantShouldSpecialUpdate ? 'indeterminate' : latestProps.variant, + [propName]: event.target.value, + } + }); onChange?.(event as React.SyntheticEvent); }} >