-
Notifications
You must be signed in to change notification settings - Fork 4.7k
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 | Renders empty label when the label is not defined #9482
Comments
I totally agree with this. |
workaround -> define label= "Edit", but include classes p-button-icon-only no-label where |
Yeah, you can solve most things by applying custom styles, but you shouldn't really have to. The problem with a bunch of these components is that people have been using work-arounds to solve other issues too, and as a result the issues have been hanging around for years. |
any updates? |
Any news? |
I have a similar issue, when I declare
This is shown So I decided to use the workaround written by @rsilva1959
With this style
And the result is |
I'm sorry, but I don't think it solved. You closed this issue, but it still inserts I don't understand why it can't just render nothing if there is no label/icon? |
Any news about this bug? |
https://stackblitz.com/edit/github-bd8xy8?file=src%2Fapp%2Fapp.component.html <--- example showing the bug.
renders
expected render
|
What I did to solve this bug is get the class of element span inside the button tag and "display: none". Use this to a specific element, cause' maybe later you will need this element in another button |
Still not resolved. (╯‵□′)╯︵┻━┻ |
Still not resolved!!! I HATE THIS BUG
For hardcode resolve |
The bug still exists! |
Fixed #9482 - Button | Renders empty label when the label is not defined
I'm submitting a ... (check one with "x")
Current behavior
When no label is assigned to pButton, text
is rendered.Expected behavior
When no label is assigned to pButton, the text should be empty, not space nor
Minimal reproduction of the problem with instructions
https://stackblitz.com/edit/github-7rxhpm?file=src/app/app.component.html
https://github.com/primefaces/primeng/blob/master/src/app/components/button/button.ts
e.g. line 45
labelElement.appendChild(document.createTextNode(this.label||' '));
the expression
this.label||' '
should be replaced withthis.label === undefined || this.label === null ? '': this.label
The text was updated successfully, but these errors were encountered: