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 with empty label and text shows "ui-button" #1657

Closed
Emdee89 opened this issue Dec 22, 2016 · 7 comments
Closed

Button with empty label and text shows "ui-button" #1657

Emdee89 opened this issue Dec 22, 2016 · 7 comments
Assignees
Labels
Type: Bug Issue contains a bug related to a specific component. Something about the component is not working
Milestone

Comments

@Emdee89
Copy link

Emdee89 commented Dec 22, 2016

**I'm submitting a bug report.

Plunkr Case (Bug Reports)
http://plnkr.co/edit/Vtp8OTakHAekaZOc6kUl?p=preview

Current behavior
I have a button with no label and no further content (only want to show its icon):
<button pButton id="menuButtonWeights" type="button" label="" icon="fa-balance-scale" class="ui-button-secondary"></button>
The button shows the text "ui-button" right to the icon.

Expected behavior
Only the icon should be visible, thus the text "ui-button" should not occur.

Minimal reproduction of the problem with instructions

What is the motivation / use case for changing the behavior?
I only need a button with an icon and w/o text.

Please tell us about your environment:
PrimeNG 1.1.1, Angular 2.4.0

  • Angular version: 2.0.X
    2.4.0

  • PrimeNG version: 2.0.X
    PrimeNG 1.1.1

All browsers

@Mrtcndkn
Copy link
Contributor

Hi,

It's the default label value of p-button.If you describe a label="" like this it will show default value.If you dont want anything to write just delete label property.

@Mrtcndkn Mrtcndkn self-assigned this Dec 22, 2016
@Mrtcndkn Mrtcndkn added the Resolution: Wontfix Issue will not be fixed due to technical limitations label Dec 22, 2016
@rafaelcoutinho
Copy link

Think it's related to this issue. I want to use Material icons (other than font-awesome ones). If I create a tag like this:
<button pButton type="button" ><i class="material-icons">accessible</i> MyBtn</button>

It is displaying the ui-button text
image

@Mrtcndkn
Copy link
Contributor

You should do that via css you can take look at ultima-ng

http://www.primefaces.org/ultima-ng/#/sample

@JuanELo-O
Copy link

Hi!,

I have a similar issue when I try to interpolate a label value, in older releases I don't have this problem.

This is my code:

<button type="button"
                pButton
                icon="fa-close"
                label="{{'no' | translate}}"
                class="secondary"
                (click)="confDialog.reject();"></button>

And this is my button:

buttonno

Only if I put the label directly it works.

@nguyenjk
Copy link

I have no label but it is still showing ui-button as a text.

angular: 2.4.4
primeng: 2.0.1

@Kappyh
Copy link

Kappyh commented Aug 23, 2017

If you are using angular.cli try this:
(Sorry for bad english)

In angular-cli.json file insert a style.css in this order

"styles":[
"../node_modules/primeng/resources/primeng.min.css",
        "./app/resources/css/styles.css"]

After this, recompile the project.

Style css file insert this:

.ui-button-text-only .ui-button-text{
    display: none !important;
}

Button config in html:

<button pButton 
            [disabled]="!(usuario.login.length > 0 && usuario.password.length > 0)"
            class="btn btn-primary"
            icon="fa-sign-in"
            type="submit">
            <i class="fa fa-fw fa-sign-in"> <!-- my icon -->
            </i>Entrar</button>

Worked for me, I hope this can help someone.

@cagataycivici cagataycivici self-assigned this Nov 23, 2017
@cagataycivici cagataycivici added confirmed Type: Bug Issue contains a bug related to a specific component. Something about the component is not working and removed Resolution: Wontfix Issue will not be fixed due to technical limitations labels Nov 23, 2017
@cagataycivici cagataycivici added this to the 5.0.1 milestone Nov 23, 2017
cagataycivici pushed a commit that referenced this issue Nov 23, 2017
@sabithpocker
Copy link

Label is empty when using async pipe also with an Observable

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

8 participants