diff --git a/docs/data/material/migration/upgrade-to-v6/upgrade-to-v6.md b/docs/data/material/migration/upgrade-to-v6/upgrade-to-v6.md index a6efdaa62f5cd1..532a70fcc9ed0c 100644 --- a/docs/data/material/migration/upgrade-to-v6/upgrade-to-v6.md +++ b/docs/data/material/migration/upgrade-to-v6/upgrade-to-v6.md @@ -365,10 +365,6 @@ As the `ListItem` no longer supports these props, the class names related to the +listItemButtonClasses.selected ``` -### Loading Button - -In v6, the `children` prop passed to the Loading Button component is now wrapped in a `` tag to avoid [issues](https://github.com/mui/material-ui/issues/27853) when using tools to translate websites. - ### Rating Previously, due to a bug, the `aria-label` attribute was "null Stars" when no value was set in the Rating component. diff --git a/packages/mui-lab/src/LoadingButton/LoadingButton.js b/packages/mui-lab/src/LoadingButton/LoadingButton.js index 13d5a9aec21df1..c3b17dacf5d9c7 100644 --- a/packages/mui-lab/src/LoadingButton/LoadingButton.js +++ b/packages/mui-lab/src/LoadingButton/LoadingButton.js @@ -229,7 +229,7 @@ const LoadingButton = React.forwardRef(function LoadingButton(inProps, ref) { {loadingIndicator} - ) : null; + ) : ; return ( - {ownerState.loadingPosition === 'end' ? ( - {children} - ) : ( - loadingButtonLoadingIndicator - )} - - {ownerState.loadingPosition === 'end' ? ( - loadingButtonLoadingIndicator - ) : ( - {children} - )} + {ownerState.loadingPosition === 'end' ? null : loadingButtonLoadingIndicator} + {children} + {ownerState.loadingPosition === 'end' ? loadingButtonLoadingIndicator : null} ); }); diff --git a/packages/mui-utils/src/composeClasses/composeClasses.ts b/packages/mui-utils/src/composeClasses/composeClasses.ts index 2b8e91af5fb540..88fe25b1c3cc07 100644 --- a/packages/mui-utils/src/composeClasses/composeClasses.ts +++ b/packages/mui-utils/src/composeClasses/composeClasses.ts @@ -17,10 +17,10 @@ export default function composeClasses( for (let i = 0; i < slot.length; i += 1) { const value = slot[i]; if (value) { - buffer += getUtilityClass(value) + ' '; + buffer += (buffer === '' ? '' : ' ') + getUtilityClass(value); if (classes && classes[value]) { - buffer += classes[value] + ' '; + buffer += ' ' + classes[value]; } } }