primeng icon indicating copy to clipboard operation
primeng copied to clipboard

ToggleButton bug: incorrect background color when not checked (value=false) PrimeNG 9.0.6-9.1.2

Open tanis138 opened this issue 6 years ago • 4 comments

I'm submitting a ... (check one with "x")

[x] bug report => Search github for a similar issue or PR before submitting
[ ] feature request => Please check if request is not on the roadmap already https://github.com/primefaces/primeng/wiki/Roadmap
[ ] support request => Please do not submit support request here, instead see http://forum.primefaces.org/viewforum.php?f=35

Current behavior Checked and unchecked ToggleButton has blue background color: https://www.primefaces.org/primeng/showcase/#/togglebutton

Expected behavior Unchecked ToggleButton should be gray: https://www.primefaces.org/primeng/v8.2.5-lts/#/togglebutton

Minimal reproduction of the problem with instructions Reproduced here: https://www.primefaces.org/primeng/showcase/#/togglebutton Bug was introduced in PrimeNG 9.0.6

  • Angular version: 9.1.3

  • PrimeNG version: 9.1.0

ToggleButton v8-v9.0.5: ToggleButton v8

ToggleButton v9.0.6-v9.1.0: ToggleButton v9 1 0

tanis138 avatar Jun 04 '20 11:06 tanis138

The same

MaxiAringoli avatar Jun 25 '20 12:06 MaxiAringoli

Still not working in PrimeNG 9.1.2: https://www.primefaces.org/primeng/showcase/#/togglebutton Button is blue in both states (checked and unchecked) By the way, on hover button colors are correct: blue when checked and gray when unchecked. It is obviously a bug and I regret that it is ignored by developers.

tanis138 avatar Jul 02 '20 09:07 tanis138

I suspect this is very low prio for them (seeing there are 600+ open issues) but, until a PR fixes this, we can style the button manually: CSS:

.toggle-button-patch {
  border: 1px solid #c8c8c8 !important;
  .ui-button-text.ui-unselectable-text {
    background-color: #c8c8c8;
    color: #333333;
  }
}

HTML: <p-toggleButton [styleClass]="isActive ? '' : 'toggle-button-patch'" ...

mikela avatar Jul 02 '20 11:07 mikela

Fixed in https://github.com/primefaces/primeng/commit/2fb9cec91ca7fef80feda2cd0f485ca151fccbfa

yigitfindikli avatar Jul 21 '20 14:07 yigitfindikli