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

p-button style property doesn't work at all #8184

Closed
mikep-dev opened this issue Oct 1, 2019 · 1 comment
Closed

p-button style property doesn't work at all #8184

mikep-dev opened this issue Oct 1, 2019 · 1 comment
Assignees
Labels
Type: Bug Issue contains a bug related to a specific component. Something about the component is not working
Milestone

Comments

@mikep-dev
Copy link

I'm submitting a ...

[x] bug report
[ ] feature request
[ ] support request

Plunkr Case (Bug Reports)
https://stackblitz.com/edit/github-dnh5qe?file=src/app/app.component.html

Current behavior
Cannot change styles of an element using style property of p-button.

Expected behavior
Should be possible to change styles using style property of p-button just as e.g. overlayPanel.

Minimal reproduction of the problem with instructions

  1. Go to stackblitz above.
  2. Note that binding styles to p-button doesnt work.

What is the motivation / use case for changing the behavior?
Property is listed in documentation but its implementation is flawed. It's not possible to easily dynamically change styles of a button inside p-button.

  • Angular version: 7.2.3

  • PrimeNG version: 7.1.3, also checked on newest

  • Browser: all

@mikep-dev
Copy link
Author

After research I found a source of the problem. In component src/app/components/button/button.ts input property style is binded in template to style property of a <button>.

    <button [attr.type]="type" [class]="styleClass" [style]="style" [disabled]="disabled"

style property has completely different syntax and current implementation just cannot work.

It should be ngStyle instead.

    <button [attr.type]="type" [class]="styleClass" [ngStyle]="style" [disabled]="disabled"

@yigitfindikli yigitfindikli self-assigned this Oct 4, 2019
@yigitfindikli yigitfindikli added the Type: Bug Issue contains a bug related to a specific component. Something about the component is not working label Oct 4, 2019
@yigitfindikli yigitfindikli added this to the 8.1.0 milestone Oct 4, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: Bug Issue contains a bug related to a specific component. Something about the component is not working
Projects
None yet
Development

No branches or pull requests

2 participants