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 busy button dots to be smaller when button is small #7235

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

britt6612
Copy link
Collaborator

What does this PR do?

This PR changes the size of the dots in the busy animation button

Where should the reviewer start?

busyAnimation.js

What testing has been done on this PR?

storybook

How should this be manually tested?

storybook

Do Jest tests follow these best practices?

  • screen is used for querying.
  • The correct query is used. (Refer to this list of queries)
  • asFragment() is used for snapshot testing.

Any background context you want to provide?

#7225

What are the relevant issues?

closes #7225

Screenshots (if appropriate)

Do the grommet docs need to be updated?

no

Should this PR be mentioned in the release notes?

maybe

Is this change backwards compatible or is it a breaking change?

backwards compatible

const Dot = styled(Box)`
background-color: currentColor;
width: 8px;
height: 8px;
width: ${(props) => (props.size.size === 'small' ? '4px' : '8px')};
Copy link
Collaborator

Choose a reason for hiding this comment

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

It's not necessarily that the button has prop size="small" but rather that if the label is really short, the width of the button is more narrow, causing the "dots" to squish.

I'm wondering if instead these "Dot"s should just have a flex={false}?

Copy link
Collaborator

Choose a reason for hiding this comment

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

If the dots have flex={false} and the label is really short would the Button size grow horizontally when it enters the busy state?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

aw I didnt check the label so even on a medium size button with a small label this is happening

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

☝️
so yes when we have flex={false} then the dots are not in the correct space. We may need to check the size of the button if it is under 100px seems to be where it is happening then change the values.

Screen.Recording.2024-05-20.at.5.03.07.PM.mov

@britt6612
Copy link
Collaborator Author

Converting to draft for now..
The issue is even if we have a min-height and min-width for the dots there is still not enough room in the middle (because of the pad) of the bottom therefore the 3 dots are overflowing and getting shifted to the right.

@britt6612 britt6612 marked this pull request as draft May 24, 2024 21:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Button -- busy indicator gets squished when button is narrow
3 participants