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: No margin/padding between button text and loading spinner #4320

Closed
ewenjo opened this issue Apr 30, 2023 · 3 comments
Closed

Button: No margin/padding between button text and loading spinner #4320

ewenjo opened this issue Apr 30, 2023 · 3 comments
Assignees
Labels
Type: Bug Issue contains a defect related to a specific component.
Milestone

Comments

@ewenjo
Copy link
Contributor

ewenjo commented Apr 30, 2023

Describe the bug

Buttons without an icon have no margin between the loading spinner and the button text. Although, I'm not entirely sure if this is a bug or intended behavior.

image

Reproducer

https://codesandbox.io/s/primereact-demo-forked-u2xxwe?file=/src/App.js

PrimeReact version

9.3.1

React version

18.x

Language

TypeScript

Build / Runtime

Create React App (CRA)

Browser(s)

No response

Steps to reproduce the behavior

Create a button without setting an icon, set the loading state.

Expected behavior

I would expect there to be some padding, similar to the padding there is when a button has an icon.

@ewenjo ewenjo added the Status: Needs Triage Issue will be reviewed by Core Team and a relevant label will be added as soon as possible label Apr 30, 2023
@melloware melloware added Type: Bug Issue contains a defect related to a specific component. and removed Status: Needs Triage Issue will be reviewed by Core Team and a relevant label will be added as soon as possible labels May 1, 2023
@melloware
Copy link
Member

melloware commented May 1, 2023

The issue is the theme is doing this on purpose for some reason:

.p-button.p-button-loading-label-only .p-button-loading-icon {
  margin: 0;
}

Workaround is to add this CSS.

.p-button.p-button-loading-label-only .p-button-loading-icon.p-button-icon-left {
  margin-right: 0.5rem;
}

@melloware melloware added Component: Theme Issue or pull request is related to Theme Resolution: Workaround Issue or pull request contains a workaround. It needs to be reviewed further by Core Team and removed Type: Bug Issue contains a defect related to a specific component. labels May 1, 2023
@melloware
Copy link
Member

OK I submitted a theme fix.

@melloware melloware added this to the 9.4.0 milestone May 10, 2023
@ulasturann ulasturann added Type: Bug Issue contains a defect related to a specific component. and removed Resolution: Workaround Issue or pull request contains a workaround. It needs to be reviewed further by Core Team Component: Theme Issue or pull request is related to Theme labels May 11, 2023
@melloware
Copy link
Member

Nice fix @ulasturann !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: Bug Issue contains a defect related to a specific component.
Projects
None yet
Development

No branches or pull requests

5 participants