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

[button] Fix loading button regression #43400

Closed
Show file tree
Hide file tree
Changes from 1 commit
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
4 changes: 0 additions & 4 deletions docs/data/material/migration/upgrade-to-v6/upgrade-to-v6.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 `<span>` 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.
Expand Down
14 changes: 3 additions & 11 deletions packages/mui-lab/src/LoadingButton/LoadingButton.js
Original file line number Diff line number Diff line change
Expand Up @@ -241,17 +241,9 @@ const LoadingButton = React.forwardRef(function LoadingButton(inProps, ref) {
classes={classes}
ownerState={ownerState}
>
{ownerState.loadingPosition === 'end' ? (
<span>{children}</span>
) : (
loadingButtonLoadingIndicator
)}

{ownerState.loadingPosition === 'end' ? (
loadingButtonLoadingIndicator
) : (
<span>{children}</span>
)}
{ownerState.loadingPosition === 'end' ? null : loadingButtonLoadingIndicator}
{children}
{ownerState.loadingPosition === 'end' ? loadingButtonLoadingIndicator : null}
</LoadingButtonRoot>
);
});
Expand Down
Loading