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

Fix Appbar custom content flickers when loading #5434

Merged
merged 3 commits into from
Oct 23, 2020
Merged

Conversation

fzaninotto
Copy link
Member

The size of the spinner isn't exactly the same as the size of the refresh button. As a consequence, if the AppBar has a custom content, this content moves a bit when the app loads data.

Making the size of the two components match exactly fixes the bug.

Before

spinner2

After

spinner1

The size of the spinner isn't exactly the same as the size of the refresh button. As a consequence, if the AppBar has a custom content, this content moves a bit when the app loads data.

Making the size of the two components match exactly fixes the bug.
@fzaninotto fzaninotto added the RFR Ready For Review label Oct 22, 2020
@fzaninotto fzaninotto added this to the 3.9.5 milestone Oct 22, 2020
@@ -11,7 +11,7 @@ import RefreshIconButton from '../button/RefreshIconButton';
const useStyles = makeStyles(
{
loader: {
margin: 14,
margin: 16,
Copy link
Contributor

Choose a reason for hiding this comment

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

Why don't use theme.spacing(2) ? Could use the useTheme hook in the component as well

@@ -27,8 +27,8 @@ const LoadingIndicator = props => {
<CircularProgress
className={classNames('app-loader', classes.loader, className)}
color="inherit"
size={18}
thickness={5}
size="1em"
Copy link
Contributor

Choose a reason for hiding this comment

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

You might want to get the theme from useTheme and apply the same spacing

@djhi djhi merged commit 2a03f18 into master Oct 23, 2020
@djhi djhi deleted the fix-spinner-flickering branch October 23, 2020 07:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
RFR Ready For Review
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants