primevue icon indicating copy to clipboard operation
primevue copied to clipboard

Button: Conflicting disabled state during loading

Open samuelwei opened this issue 7 months ago • 2 comments

Describe the bug

The Button component has a loading prop to disable the button and show a spinner. If the loading prop is true: The disabled attribute is set, as well as data-p-disabled="true"

<button class="p-button p-component p-button-loading" type="button" aria-label="Button" data-pc-name="button" data-p-disabled="true" pc0="" data-pc-section="root" disabled="">....</button>

However if while loading=true disabled=false the buttons disabled state is in an unclear state. The disabled attribute is missing, while data-p-disabled="true".

<button class="p-button p-component p-button-loading" type="button" aria-label="Button" data-pc-name="button" data-p-disabled="true" pc0="" data-pc-section="root">....</button>

Pull Request Link

https://github.com/primefaces/primevue/pull/7712

Reason for not contributing a PR

  • [ ] Lack of time
  • [ ] Unsure how to implement the fix/feature
  • [ ] Difficulty understanding the codebase
  • [ ] Other

Other Reason

No response

Reproducer

https://stackblitz.com/edit/primevue-4-vite-issue-template-pkrbvmge

Environment

Stackblitz

Vue version

3.5.13

PrimeVue version

4.3.6

Node version

No response

Browser(s)

No response

Steps to reproduce the behavior

  1. Go to StackBlitz reproducer
  2. See button is loading but not disabled

Expected behavior

The button should always be disabled if it is loading, ignoring the value of the disabled prop

samuelwei avatar May 15 '25 14:05 samuelwei

Update: Still an issue with PrimeVue 4.3.6

samuelwei avatar Jul 08 '25 12:07 samuelwei

Still doesn't work with primevue 4.4.1

YannisJustine avatar Oct 30 '25 06:10 YannisJustine